Fixes a Lua nil method call

Fixes
[Lua.cpp:4815] WARNING: Script failure [/Users/simone/code/ntopng/scripts/lua/iface_flows_sankey.lua][...rs/simone/code/ntopng/scripts/lua/iface_flows_sankey.lua:112: attempt to call field 'getHosts' (a nil value)]
This commit is contained in:
Simone Mainardi 2016-02-25 16:42:53 +01:00
parent b4fd6053df
commit ae5d45309d

View file

@ -109,7 +109,7 @@ if ((num == 0) and (tracked_host == nil)) then
-- 2.1 It looks like in this network there are many flows with no clear predominant traffic
-- Then we take the host with most traffic and print flows belonging to it
hosts_stats = interface.getHosts()
hosts_stats = interface.getHostsInfo()
for key, value in pairs(hosts_stats) do
value = hosts_stats[key]["traffic"]
if((value ~= nil) and (value > top_value)) then