Fixes a nil-key table access

The following error has been fixed:
28/Dec/2015 11:40:02 [Lua.cpp:4447] WARNING: Script failure [/Users/simone/code/ntopng/scripts/callbacks/minute.lua][...s/simone/code/ntopng/scripts/lua/modules/top_talkers.lua:221: table index is nil]
This commit is contained in:
Simone Mainardi 2015-12-28 11:49:23 +01:00
parent bb3bb48f11
commit 677d32672d

View file

@ -214,7 +214,8 @@ function groupStatsByColumn(ifid, ifname, col)
for _key, value in pairs(hosts_stats) do
key = hosts_stats[_key][col]
if ((col == "country" and key == "") or
if ((not key) or
(col == "country" and key == "") or
(col == "local_network_id" and key == -1) or
(col == "os" and key == "")) then goto continue end
if (_group[key] == nil) then