From d75e3d56b5128e4489f635a412cb12bf02e9f18f Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Wed, 8 Feb 2012 15:33:36 +0100 Subject: util.prosodyctl: In the register command, check that the virtual exists before proceeding. --- util/prosodyctl.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'util') diff --git a/util/prosodyctl.lua b/util/prosodyctl.lua index d0045abc..6e9eed4e 100644 --- a/util/prosodyctl.lua +++ b/util/prosodyctl.lua @@ -121,7 +121,11 @@ function adduser(params) 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 -- cgit v1.2.3