Merge with daurnimator
[prosody.git] / plugins / muc / muc.lib.lua
index 27c50cd48a74748473563f70dbd631772074b451..5debb4a36ada98541951e43ce976fd3878c5f432 100644 (file)
@@ -1265,7 +1265,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:get_occupant_jid(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;