aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--plugins/mod_console.lua8
1 files changed, 6 insertions, 2 deletions
diff --git a/plugins/mod_console.lua b/plugins/mod_console.lua
index 19c22c91..a46eec12 100644
--- a/plugins/mod_console.lua
+++ b/plugins/mod_console.lua
@@ -345,9 +345,13 @@ function def_env.module:list(hosts)
local print = self.session.print;
for _, host in ipairs(hosts) do
print(host..":");
- local modules = array.collect(keys(prosody.hosts[host].modules or {})):sort();
+ local modules = array.collect(keys(prosody.hosts[host] and prosody.hosts[host].modules or {})):sort();
if #modules == 0 then
- print(" No modules loaded");
+ if prosody.hosts[host] then
+ print(" No modules loaded");
+ else
+ print(" Host not found");
+ end
else
for _, name in ipairs(modules) do
print(" "..name);