diff options
author | Kim Alvefur <zash@zash.se> | 2012-02-08 15:33:36 +0100 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2012-02-08 15:33:36 +0100 |
commit | 4727cb1adaeac099ca2cbd3629271199f8c79da3 (patch) | |
tree | d6941404f66528ee398fee9570a5e1c8c899f6bb /util/prosodyctl.lua | |
parent | ac28f69701b2189b085159bef9a9d83c4a15c51d (diff) | |
download | prosody-4727cb1adaeac099ca2cbd3629271199f8c79da3.tar.gz prosody-4727cb1adaeac099ca2cbd3629271199f8c79da3.zip |
util.prosodyctl: In the register command, check that the virtual exists before proceeding.
Diffstat (limited to 'util/prosodyctl.lua')
-rw-r--r-- | util/prosodyctl.lua | 6 |
1 files changed, 5 insertions, 1 deletions
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 |