usermanager: Fixed a possible traceback when is_admin() was used on a component.

Fri, 17 Dec 2010 22:54:34 +0500

author
Waqas Hussain <waqas20@gmail.com>
date
Fri, 17 Dec 2010 22:54:34 +0500
changeset 3887
9aa109f8b960
parent 3886
b40fbbd15ba3
child 3888
8e98ad57fcbb

usermanager: Fixed a possible traceback when is_admin() was used on a component.

core/usermanager.lua file | annotate | diff | comparison | revisions
--- a/core/usermanager.lua	Fri Dec 17 17:11:04 2010 +0000
+++ b/core/usermanager.lua	Fri Dec 17 22:54:34 2010 +0500
@@ -120,7 +120,7 @@
 	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;

mercurial