mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-29 15:39:33 +00:00
Fixes an error in community mode (due to NetworkInterfaceView removal)
WARNING: Script failure [/Users/simone/code/ntopng/scripts/lua/iface_hosts_list.lua][/Users/simone/code/ntopng/scripts/lua/modules/lua_utils.lua:164: attempt to get length of local 'h' (a nil value)]
This commit is contained in:
parent
34dee98540
commit
9cf1866e2f
1 changed files with 17 additions and 5 deletions
|
|
@ -156,13 +156,25 @@ end
|
|||
-- ##########################################
|
||||
|
||||
function aggregateHostsStats(hostStats)
|
||||
-- method used to aggregate stats with interface views
|
||||
-- hopefully now should be removed/short-circuited
|
||||
if(hostStats == nil) then
|
||||
return nil,0
|
||||
else
|
||||
local h = hostStats.hosts
|
||||
|
||||
local tot = #h
|
||||
return h,tot
|
||||
else
|
||||
local h
|
||||
local tot
|
||||
if hostStats.hosts ~= nil then
|
||||
h = hostStats.hosts
|
||||
tot = hostStats.numHosts
|
||||
else
|
||||
h = hostStats
|
||||
tot = 0
|
||||
for k, v in pairs(hostStats) do
|
||||
tot = tot + 1
|
||||
end
|
||||
end
|
||||
|
||||
return h,tot
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue