# HG changeset patch # User Kim Alvefur # Date 1547832483 -3600 # Node ID 5e91a34b1e71b2a9c77be19f07310dad74769d58 # Parent c4db126a9f0487360fe914b468a2dd9024a1f543 mod_muc_limits: Fix being unload on trunk rooms is nil in this case, and pairs() throws an error diff -r c4db126a9f04 -r 5e91a34b1e71 mod_muc_limits/mod_muc_limits.lua --- a/mod_muc_limits/mod_muc_limits.lua Fri Jan 18 17:02:12 2019 +0100 +++ b/mod_muc_limits/mod_muc_limits.lua Fri Jan 18 18:28:03 2019 +0100 @@ -72,13 +72,13 @@ end end -function module.unload() - for room_jid, room in pairs(rooms) do - room.throttle = nil; +if rooms then + function module.unload() + for room_jid, room in pairs(rooms) do + room.throttle = nil; + end end -end -if rooms then module:hook("message/bare", handle_stanza, 501); module:hook("message/full", handle_stanza, 501); module:hook("presence/bare", handle_stanza, 501);