Fix report error at startup

This commit is contained in:
emanuele-f 2018-07-30 09:14:20 +02:00
parent 7a3874b80b
commit 8c5b4e4ae7

View file

@ -86,7 +86,7 @@ function getProtoVolume(ifName, start_time, end_time)
-- NOTE: this could be optimized via a dedicated driver call
local data = ts_utils.query("iface:ndpi", tags, start_time, end_time)
if(data ~= nil) then
if(data ~= nil) and (data.statistics.total > 0) then
ret[tags.protocol] = data.statistics.total
end
end