Add safety checks on all calls to ifstats.probes

This commit is contained in:
Alfredo Cardigliano 2025-11-04 15:44:38 +01:00
parent 334466c1f4
commit 1057d3b397
4 changed files with 32 additions and 29 deletions

View file

@ -883,9 +883,8 @@ if ((page == "overview") or (page == nil)) then
for _, v in pairs(ifstats.probes or {}) do
for _, v1 in pairs(v or {}) do
for _, v2 in pairs(v or {}) do
if (v2["packets.total"] ~= nil) then probe_total_packets = probe_total_packets + v2["packets.total"] end
if (v2["packets.drops"] ~= nil) then probe_total_packet_drops = probe_total_packet_drops +
v2["packets.drops"] end
probe_total_packets = probe_total_packets + (v2["packets.total"] or 0)
probe_total_packet_drops = probe_total_packet_drops + (v2["packets.drops"] or 0)
end
end
end