diff mod_groups_internal/mod_groups_internal.lua @ 4419:1185acb2ab91

mod_groups_internal: handle empty groups correctly Otherwise, this causes a traceback when syncing the group.
author Jonas Schäfer <jonas@wielicki.name>
date Sun, 31 Jan 2021 16:09:14 +0100
parents 8c31d4b872c3
children ca821df93cb9
line wrap: on
line diff
--- a/mod_groups_internal/mod_groups_internal.lua	Sun Jan 31 12:20:03 2021 +0100
+++ b/mod_groups_internal/mod_groups_internal.lua	Sun Jan 31 16:09:14 2021 +0100
@@ -62,7 +62,11 @@
 end
 
 local function do_all_group_subscriptions_by_group(group_id)
-	for membername in pairs(get_members(group_id)) do
+	local members = get_members(group_id)
+	if not members then
+		return
+	end
+	for membername in pairs(members) do
 		do_single_group_subscriptions(membername, group_id);
 	end
 end