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>
This commit is contained in:
Felix Fietkau 2024-02-13 19:24:53 +01:00
parent 95cd3c7005
commit 2a2abed0be

View file

@ -39,8 +39,9 @@ function cleanup() {
} }
function wiphy_get_entry(phy, path) { function wiphy_get_entry(phy, path) {
let wlan = board_data.wlan; board_data.wlan ??= {};
let wlan = board_data.wlan;
for (let name in wlan) for (let name in wlan)
if (wlan[name].path == path) if (wlan[name].path == path)
return wlan[name]; return wlan[name];