Fixed top talkers hosts

This commit is contained in:
Luca Deri 2016-08-10 13:00:52 +02:00
parent 116ffda7c8
commit 34dee98540
5 changed files with 38 additions and 42 deletions

View file

@ -156,9 +156,14 @@ end
-- ##########################################
function aggregateHostsStats(hostStats)
local h = hostStats.hosts
local tot = #h
return h,tot
if(hostStats == nil) then
return nil,0
else
local h = hostStats.hosts
local tot = #h
return h,tot
end
end
function _aggregateHostsStats(hostStats)
@ -1086,7 +1091,7 @@ end
-- Return the first 'howmany' hosts
function getTopInterfaceHosts(howmany, localHostsOnly)
hosts_stats,total = aggregateHostsStats(interface.getHostsInfo())
hosts_stats = interface.getHostsInfo()
ret = {}
sortTable = {}
n = 0