ucentral-event: fix null pointers checking in channel switch

Invalid logical operator was used for checking null
pointers in channel_switch function: AND instead OR

Fixes: 7477963b ("ucentral-event: add channel switch handler")

Signed-off-by: Marek Kwaczynski <marek@shasta.cloud>
This commit is contained in:
Marek Kwaczynski
2025-03-07 15:45:36 +01:00
committed by John Crispin
parent 53ff49eb6f
commit 4d55d427d7

View File

@@ -142,7 +142,7 @@ function freq2chan(freq) {
* { "ifname": "wlan1", "freq": 5180, "bssid": "XX:XX:XX:XX:XX:XX"
*/
function handle_channel_switch(hapd, notify) {
if (!notify && !notify?.data && !notify.data?.freq)
if (!notify || !notify?.data || !notify.data?.freq)
return;
let ch = freq2chan(notify.data.freq);