mirror of
https://github.com/Telecominfraproject/wlan-ucentral-schema.git
synced 2026-03-20 03:41:53 +00:00
state: guard against null devstats in iface_add_counters
The devstats variable is populated via ubus call to udevstats dump, which returns null when the udevstats service is unavailable. Add a null check before indexing into devstats to prevent a runtime crash. Signed-off-by: Lannar Dean <moracca@gmail.com>
This commit is contained in:
committed by
John Crispin
parent
d26c4b0a1e
commit
e5a6295271
@@ -574,7 +574,7 @@ if (!length(state.radios))
|
||||
|
||||
|
||||
function iface_add_counters(iface, vlan, port) {
|
||||
if (!devstats[port])
|
||||
if (!devstats || !devstats[port])
|
||||
return;
|
||||
for (let k, vid in devstats[port]) {
|
||||
if (vid.vid != vlan)
|
||||
|
||||
Reference in New Issue
Block a user