Software /
code /
prosody
Diff
util/prosodyctl.lua @ 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 |
parent | 4335:3a2a01432b5c |
child | 4500:bfa387f268e2 |
child | 4501:eacc93e23f21 |
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