usermanager: Fixed a possible traceback when is_admin() was used on a component.
authorWaqas Hussain <waqas20@gmail.com>
Fri, 17 Dec 2010 17:54:34 +0000 (22:54 +0500)
committerWaqas Hussain <waqas20@gmail.com>
Fri, 17 Dec 2010 17:54:34 +0000 (22:54 +0500)
core/usermanager.lua

index c49bf4288be29ab7ce942b1cafa415249e1e508a..1aea0de9b86f6c1ad17519023b86cd9e8c20f9cb 100644 (file)
@@ -120,7 +120,7 @@ function is_admin(jid, host)
        end
        
        -- Still not an admin, check with auth provider
-       if not is_admin and host ~= "*" and hosts[host].users.is_admin then
+       if not is_admin and host ~= "*" and hosts[host].users and hosts[host].users.is_admin then
                is_admin = hosts[host].users.is_admin(jid);
        end
        return is_admin or false;