# HG changeset patch # User Matthew Wild # Date 1370705473 -3600 # Node ID 1255de347dd4fbe5c9622dd8835209ee8d093fdf # Parent 0b41122b19f967983e95350e8fe14831395cca42 mod_muc_limits: Fix traceback on presence sent to the room's bare JID diff -r 0b41122b19f9 -r 1255de347dd4 mod_muc_limits/mod_muc_limits.lua --- a/mod_muc_limits/mod_muc_limits.lua Fri Jun 07 14:29:01 2013 +0100 +++ b/mod_muc_limits/mod_muc_limits.lua Sat Jun 08 16:31:13 2013 +0100 @@ -38,7 +38,7 @@ if (occupant and occupant.affiliation) or (not(occupant) and room._affiliations[jid_bare(from_jid)]) then module:log("debug", "Skipping stanza from affiliated user..."); return; - elseif max_nick_length and stanza.name == "presence" and not room._occupants[stanza.attr.to] and #dest_nick > max_nick_length then + elseif dest_nick and max_nick_length and stanza.name == "presence" and not room._occupants[stanza.attr.to] and #dest_nick > max_nick_length then module:log("debug", "Forbidding long (%d bytes) nick in %s", #dest_nick, dest_room) origin.send(st.error_reply(stanza, "modify", "policy-violation", "Your nick name is too long, please use a shorter one") :up():tag("x", { xmlns = xmlns_muc }));