Browse Source

wifi-scripts: create the wlan object in board_data if not present

Fixes an error in wifi detection

Signed-off-by: Felix Fietkau <[email protected]>
Felix Fietkau 2 years ago
parent
commit
2a2abed0be

+ 2 - 1
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];