]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
wifi-scripts: netifd: fix null dereference in config_init for missing devices
authorFelix Fietkau <nbd@nbd.name>
Sun, 15 Feb 2026 08:23:57 +0000 (08:23 +0000)
committerFelix Fietkau <nbd@nbd.name>
Mon, 16 Feb 2026 08:20:22 +0000 (08:20 +0000)
Add optional chaining when accessing device config in the wifi-iface
loop to handle cases where a referenced device doesn't exist.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
(cherry picked from commit 8b994ed3970ffd02ee77889304ca32bdbecdb1f3)

package/network/config/wifi-scripts/files/lib/netifd/wireless.uc

index cb505a9eb8b9611e26fca9797e824e8501b3d28b..513fa30ef72c195af9adffc01f654cc1aeddde6e 100644 (file)
@@ -133,7 +133,7 @@ function config_init(uci)
                let mlo_vif = parse_bool(data.mlo);
                let radios = map(dev_names, (v) => radio_idx[v]);
                radios = filter(radios, (v) => v != null);
-               let radio_config = map(dev_names, (v) => devices[v].config);
+               let radio_config = map(dev_names, (v) => devices[v]?.config);
                let ifname;
                let mlo_created = false;