wifi-scripts: ucode: iwinfo: skip uninitialized PHYs
They show up as null entries in the nl80211 wiphy dump. Fixes the following error: Reference error: left-hand side expression is null In find_phy(), file /usr/share/ucode/iwinfo.uc, line 19, byte 11: called from function get_max_power (/usr/share/ucode/iwinfo.uc:42:32) called from function module (/usr/share/ucode/iwinfo.uc:102:39) called from anonymous function (/usr/bin/iwinfo:5:25) ` if (phy.wiphy == wiphy)` Near here ------^ Signed-off-by: Felix Fietkau <nbd@nbd.name>
This commit is contained in:
parent
874e0accae
commit
12b8d5c83c
@ -16,7 +16,7 @@ let wireless_status = ubus.call('network.wireless', 'status');
|
|||||||
|
|
||||||
function find_phy(wiphy) {
|
function find_phy(wiphy) {
|
||||||
for (let k, phy in phys)
|
for (let k, phy in phys)
|
||||||
if (phy.wiphy == wiphy)
|
if (phy && phy.wiphy == wiphy)
|
||||||
return phy;
|
return phy;
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user