From: Felix Fietkau Date: Tue, 13 Feb 2024 18:24:53 +0000 (+0100) Subject: wifi-scripts: create the wlan object in board_data if not present X-Git-Url: http://git.openwrt.org/?a=commitdiff_plain;h=2a2abed0be6078368b7dc6b7730794b481d32a0e;p=openwrt%2Fstaging%2Frobimarko.git wifi-scripts: create the wlan object in board_data if not present Fixes an error in wifi detection Signed-off-by: Felix Fietkau --- 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];