]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
wifi-scripts: ucode: fix iwinfo crash on untracked interfaces
authorFelix Fietkau <nbd@nbd.name>
Mon, 30 Jun 2025 11:13:03 +0000 (13:13 +0200)
committerFelix Fietkau <nbd@nbd.name>
Sat, 5 Jul 2025 12:41:00 +0000 (14:41 +0200)
Deal with data.radio being null

Signed-off-by: Felix Fietkau <nbd@nbd.name>
package/network/config/wifi-scripts/files-ucode/usr/share/ucode/iwinfo.uc

index 811c4487a0ac4ce411d07671c180e8e62ee143de..29d75b41309ff10b56e422344a7a7cf42e4d3a31 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 || !iface.radio.band)
+       if (!phy || !iface.radio?.band)
                return '';
        let htmodes = phy.info.bands[uc(iface.radio.band)].modes;
        let list = [];
@@ -393,7 +393,7 @@ export function info(name) {
                        mode: data.mode,
                        channel: format_channel(data.wiphy_freq),
                        freq: format_frequency(data.wiphy_freq),
-                       htmode: data.radio.htmode,
+                       htmode: data.radio?.htmode,
                        center_freq1: format_channel(data.center_freq1) || 'unknown',
                        center_freq2: format_channel(data.center_freq2) || 'unknown',
                        txpower: data.wiphy_tx_power_level / 100,