소스 검색

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 1 년 전
부모
커밋
2a2abed0be
1개의 변경된 파일2개의 추가작업 그리고 1개의 파일을 삭제
  1. 2 1
      package/network/config/wifi-scripts/files/usr/share/hostap/wifi-detect.uc

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