Changeset

4499:55ef5d83d00a

util.prosodyctl: In the register command, check that the virtual exists before proceeding.
author Kim Alvefur <zash@zash.se>
date Wed, 08 Feb 2012 15:33:36 +0100
parents 4498:9454d237cf7c
children 4500:bfa387f268e2 4501:eacc93e23f21
files util/prosodyctl.lua
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/util/prosodyctl.lua	Fri Dec 16 16:01:59 2011 +0000
+++ b/util/prosodyctl.lua	Wed Feb 08 15:33:36 2012 +0100
@@ -121,7 +121,11 @@
 		return false, "invalid-hostname";
 	end
 
-	local provider = prosody.hosts[host].users;
+	local host = prosody.hosts[host];
+	if not host then
+		return false, "no-such-host";
+	end
+	local provider = host.users;
 	if not(provider) or provider.name == "null" then
 		usermanager.initialize_host(host);
 	end