Mercurial > prosody-modules
diff mod_csi_muc_priorities/mod_csi_muc_priorities.lua @ 3992:0233da912ab6
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.
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Thu, 23 Apr 2020 22:07:44 +0200 |
parents | 569f754bd126 |
children | 1b68954a743a |
line wrap: on
line diff
--- 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