From 2a2abed0be6078368b7dc6b7730794b481d32a0e Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Tue, 13 Feb 2024 19:24:53 +0100 Subject: [PATCH] wifi-scripts: create the wlan object in board_data if not present Fixes an error in wifi detection Signed-off-by: Felix Fietkau --- .../config/wifi-scripts/files/usr/share/hostap/wifi-detect.uc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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]; -- 2.30.2