Comparison

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
parent 4418:8c31d4b872c3
child 4423:ca821df93cb9
comparison
equal deleted inserted replaced
4418:8c31d4b872c3 4419:1185acb2ab91
60 do_single_group_subscriptions(username, group_id); 60 do_single_group_subscriptions(username, group_id);
61 end 61 end
62 end 62 end
63 63
64 local function do_all_group_subscriptions_by_group(group_id) 64 local function do_all_group_subscriptions_by_group(group_id)
65 for membername in pairs(get_members(group_id)) do 65 local members = get_members(group_id)
66 if not members then
67 return
68 end
69 for membername in pairs(members) do
66 do_single_group_subscriptions(membername, group_id); 70 do_single_group_subscriptions(membername, group_id);
67 end 71 end
68 end 72 end
69 73
70 module:hook("resource-bind", function(event) 74 module:hook("resource-bind", function(event)