]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
wifi-scripts: iwinfo(ucode): add missing null checks
authorFelix Fietkau <nbd@nbd.name>
Thu, 26 Jun 2025 17:44:43 +0000 (19:44 +0200)
committerFelix Fietkau <nbd@nbd.name>
Thu, 26 Jun 2025 17:44:43 +0000 (19:44 +0200)
Signed-off-by: Felix Fietkau <nbd@nbd.name>
package/network/config/wifi-scripts/files-ucode/usr/share/ucode/iwinfo.uc

index a85614cdcb42b4dceac528e80778176cebf42f4e..811c4487a0ac4ce411d07671c180e8e62ee143de 100644 (file)
@@ -285,7 +285,7 @@ function hwmodelist(name) {
        const mode = { 'HT*': 'n', 'VHT*': 'ac', 'HE*': 'ax' };
        let iface = ifaces[name];
        let phy = board_data.wlan?.['phy' + iface.wiphy];
-       if (!phy)
+       if (!phy || !iface.radio.band)
                return '';
        let htmodes = phy.info.bands[uc(iface.radio.band)].modes;
        let list = [];
@@ -446,7 +446,7 @@ export function info(name) {
 export function htmodelist(name) {
        let iface = ifaces[name];
        let phy = board_data.wlan?.['phy' + iface.wiphy];
-       if (!phy)
+       if (!phy || !iface.radio.band)
                return [];
 
        return filter(phy.info.bands[uc(iface.radio.band)].modes, (v) => v != 'NOHT');