summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@nbd.name>2024-02-13 19:24:53 +0100
committerFelix Fietkau <nbd@nbd.name>2024-02-13 19:26:58 +0100
commit2a2abed0be6078368b7dc6b7730794b481d32a0e (patch)
tree3115ea37aa4e333bba669a61eb972078fe151cdc
parent95cd3c700510b0763cc25e3ed135c174b162fa6f (diff)
downloadopenwrt-2a2abed0be6078368b7dc6b7730794b481d32a0e.tar.gz
openwrt-2a2abed0be6078368b7dc6b7730794b481d32a0e.tar.bz2
openwrt-2a2abed0be6078368b7dc6b7730794b481d32a0e.zip
wifi-scripts: create the wlan object in board_data if not present
Fixes an error in wifi detection Signed-off-by: Felix Fietkau <nbd@nbd.name>
-rw-r--r--package/network/config/wifi-scripts/files/usr/share/hostap/wifi-detect.uc3
1 files changed, 2 insertions, 1 deletions
diff --git a/package/network/config/wifi-scripts/files/usr/share/hostap/wifi-detect.uc b/package/network/config/wifi-scripts/files/usr/share/hostap/wifi-detect.uc
index 86ec3431ea..5f375880d2 100644
--- a/package/network/config/wifi-scripts/files/usr/share/hostap/wifi-detect.uc
+++ b/package/network/config/wifi-scripts/files/usr/share/hostap/wifi-detect.uc
@@ -39,8 +39,9 @@ function cleanup() {
}
function wiphy_get_entry(phy, path) {
- let wlan = board_data.wlan;
+ board_data.wlan ??= {};
+ let wlan = board_data.wlan;
for (let name in wlan)
if (wlan[name].path == path)
return wlan[name];