mod_csi_muc_priorities: Fix bad argument to 'ipairs' on a missing list
If either of the two list-multi are empty then apparently nothing
thougth to include an empty array. Meh.
--- a/mod_csi_muc_priorities/mod_csi_muc_priorities.lua Thu Apr 23 20:12:42 2020 +0200
+++ b/mod_csi_muc_priorities/mod_csi_muc_priorities.lua Thu Apr 23 22:07:44 2020 +0200
@@ -105,11 +105,15 @@
end
local prioritized_jids = {};
if fields.unimportant then
- for _, jid in ipairs(fields.unimportant) do
- prioritized_jids[jid] = false;
+ if fields.unimportant then
+ for _, jid in ipairs(fields.unimportant) do
+ prioritized_jids[jid] = false;
+ end
end
- for _, jid in ipairs(fields.important) do
- prioritized_jids[jid] = true;
+ if fields.important then
+ for _, jid in ipairs(fields.important) do
+ prioritized_jids[jid] = true;
+ end
end
end