wifi-scripts: iwinfo(ucode): add missing null checks
Signed-off-by: Felix Fietkau <nbd@nbd.name>
This commit is contained in:
parent
fdcb0e0b24
commit
35a4608a30
1 changed files with 2 additions and 2 deletions
|
@ -285,7 +285,7 @@ function hwmodelist(name) {
|
||||||
const mode = { 'HT*': 'n', 'VHT*': 'ac', 'HE*': 'ax' };
|
const mode = { 'HT*': 'n', 'VHT*': 'ac', 'HE*': 'ax' };
|
||||||
let iface = ifaces[name];
|
let iface = ifaces[name];
|
||||||
let phy = board_data.wlan?.['phy' + iface.wiphy];
|
let phy = board_data.wlan?.['phy' + iface.wiphy];
|
||||||
if (!phy)
|
if (!phy || !iface.radio.band)
|
||||||
return '';
|
return '';
|
||||||
let htmodes = phy.info.bands[uc(iface.radio.band)].modes;
|
let htmodes = phy.info.bands[uc(iface.radio.band)].modes;
|
||||||
let list = [];
|
let list = [];
|
||||||
|
@ -446,7 +446,7 @@ export function info(name) {
|
||||||
export function htmodelist(name) {
|
export function htmodelist(name) {
|
||||||
let iface = ifaces[name];
|
let iface = ifaces[name];
|
||||||
let phy = board_data.wlan?.['phy' + iface.wiphy];
|
let phy = board_data.wlan?.['phy' + iface.wiphy];
|
||||||
if (!phy)
|
if (!phy || !iface.radio.band)
|
||||||
return [];
|
return [];
|
||||||
|
|
||||||
return filter(phy.info.bands[uc(iface.radio.band)].modes, (v) => v != 'NOHT');
|
return filter(phy.info.bands[uc(iface.radio.band)].modes, (v) => v != 'NOHT');
|
||||||
|
|
Loading…
Reference in a new issue