mod_groups_internal: Fix traceback when room doesn't exist
authorMatthew Wild <mwild1@gmail.com>
Thu, 11 Jan 2024 15:53:18 +0000
changeset 5824 742142f9771e
parent 5823 bb51cf204dd4
child 5825 c9279845fc41
mod_groups_internal: Fix traceback when room doesn't exist I'm not sure if it should even be included if it doesn't exist, but I'm not currently sure how this situation occurs, so I'm implementing the lightest possible fix for now.
mod_groups_internal/mod_groups_internal.lua
--- a/mod_groups_internal/mod_groups_internal.lua	Tue Jan 09 13:50:18 2024 +0000
+++ b/mod_groups_internal/mod_groups_internal.lua	Thu Jan 11 15:53:18 2024 +0000
@@ -422,10 +422,11 @@
 	end
 
 	return array.map(mucs, function (muc_jid)
+		local room = muc_host.get_room_from_jid(muc_jid);
 		return {
 			id = jid.node(muc_jid);
 			jid = muc_jid;
-			name = muc_host.get_room_from_jid(muc_jid):get_name() or group_info.name;
+			name = room and room:get_name() or group_info.name;
 		};
 	end);
 end