# HG changeset patch # User Kim Alvefur # Date 1695128156 -7200 # Node ID 80abda15a1e9f03367a96a53cc80545214fa6205 # Parent c20b77e5e03291bedec55aa8549c8aaa21ef2659 mod_muc_members_json: Fix potential error when removing old affiliations Found this uncommitted change on a production server... The affiliation data may been `nil` at some point, triggering an error? diff -r c20b77e5e032 -r 80abda15a1e9 mod_muc_members_json/mod_muc_members_json.lua --- a/mod_muc_members_json/mod_muc_members_json.lua Tue Sep 19 13:22:00 2023 +0200 +++ b/mod_muc_members_json/mod_muc_members_json.lua Tue Sep 19 14:55:56 2023 +0200 @@ -80,7 +80,7 @@ end -- Remove affiliation from folk who weren't in the source data but previously were for jid, aff, data in muc:each_affiliation() do - if not jids[jid] and data.source == module.name then + if not jids[jid] and data and data.source == module.name then muc:set_affiliation(true, jid, "none", "imported membership lost"); end end