Merge 0.9->0.10
[prosody.git] / plugins / muc / muc.lib.lua
index d09c768e51f60049b354e6e013fb7591096d8121..8cf8d882e5895962a2a3e779267a52e9d6cc4e46 100644 (file)
@@ -1032,7 +1032,7 @@ function room_mt:can_set_role(actor_jid, occupant_jid, role)
        if actor_jid == true then return true; end
 
        local actor = self._occupants[self._jid_nick[actor_jid]];
-       if actor.role == "moderator" then
+       if actor and actor.role == "moderator" then
                if occupant.affiliation ~= "owner" and occupant.affiliation ~= "admin" then
                        if actor.affiliation == "owner" or actor.affiliation == "admin" then
                                return true;