# HG changeset patch # User Waqas Hussain # Date 1255871405 -18000 # Node ID 1a4f14ea39b6404f4f528ac46204de0a49d42f37 # Parent 3f9cce29c57dc0314575436e34b2f14c079f0dff mod_console: Fixed traceback occuring on using module:list on unknown hosts. diff -r 3f9cce29c57d -r 1a4f14ea39b6 plugins/mod_console.lua --- a/plugins/mod_console.lua Sun Oct 18 18:01:13 2009 +0500 +++ b/plugins/mod_console.lua Sun Oct 18 18:10:05 2009 +0500 @@ -345,9 +345,13 @@ 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);