Software /
code /
prosody
Comparison
plugins/mod_console.lua @ 2010:1a4f14ea39b6
mod_console: Fixed traceback occuring on using module:list on unknown hosts.
author | Waqas Hussain <waqas20@gmail.com> |
---|---|
date | Sun, 18 Oct 2009 18:10:05 +0500 |
parent | 2009:3f9cce29c57d |
child | 2054:a43aea9b0bd1 |
comparison
equal
deleted
inserted
replaced
2009:3f9cce29c57d | 2010:1a4f14ea39b6 |
---|---|
343 end | 343 end |
344 | 344 |
345 local print = self.session.print; | 345 local print = self.session.print; |
346 for _, host in ipairs(hosts) do | 346 for _, host in ipairs(hosts) do |
347 print(host..":"); | 347 print(host..":"); |
348 local modules = array.collect(keys(prosody.hosts[host].modules or {})):sort(); | 348 local modules = array.collect(keys(prosody.hosts[host] and prosody.hosts[host].modules or {})):sort(); |
349 if #modules == 0 then | 349 if #modules == 0 then |
350 print(" No modules loaded"); | 350 if prosody.hosts[host] then |
351 print(" No modules loaded"); | |
352 else | |
353 print(" Host not found"); | |
354 end | |
351 else | 355 else |
352 for _, name in ipairs(modules) do | 356 for _, name in ipairs(modules) do |
353 print(" "..name); | 357 print(" "..name); |
354 end | 358 end |
355 end | 359 end |