# HG changeset patch # User Marco Cirillo # Date 1326228945 0 # Node ID 0afe88f9bddeaa5618065091a3ba4dd929548f30 # Parent 77f350635f4f3410d3a7bca102c3c78078671b77 mod_server_status: fixed trace case when an user, mistakenly or not, sets a component which doesn't exist into the plugin config. (thanks chris) diff -r 77f350635f4f -r 0afe88f9bdde mod_server_status/mod_server_status.lua --- a/mod_server_status/mod_server_status.lua Tue Jan 10 21:17:13 2012 +0100 +++ b/mod_server_status/mod_server_status.lua Tue Jan 10 20:55:45 2012 +0000 @@ -75,7 +75,7 @@ comps_stats[1] = response_table.comps.elem_header for _, name in ipairs(components) do comps_stats[#comps_stats+1] = response_table.comps.status:format( - name, hosts[name].modules.component and hosts[name].modules.component.connected and "online" or + name, hosts[name] and hosts[name].modules.component and hosts[name].modules.component.connected and "online" or hosts[name] and hosts[name].modules.component == nil and "online" or "offline") end comps_stats[#comps_stats+1] = response_table.comps.elem_closure @@ -101,7 +101,7 @@ if show_comps then result.components = {} for _,n in ipairs(show_comps) do - result.components[n] = hosts[n].modules.component and hosts[n].modules.component.connected and "online" or + result.components[n] = hosts[n] and hosts[n].modules.component and hosts[n].modules.component.connected and "online" or hosts[n] and hosts[n].modules.component == nil and "online" or "offline" end end