aboutsummaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
Diffstat (limited to 'util')
-rw-r--r--util/prosodyctl.lua6
1 files changed, 5 insertions, 1 deletions
diff --git a/util/prosodyctl.lua b/util/prosodyctl.lua
index 8c58f2cd..128eec2c 100644
--- a/util/prosodyctl.lua
+++ b/util/prosodyctl.lua
@@ -136,7 +136,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