summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBennyE <bennye_hh@posteo.net>2020-12-12 00:49:53 +0100
committerBennyE <bennye_hh@posteo.net>2020-12-12 00:49:53 +0100
commitc5c13620f23f7275945ef0e4c7b17a014cbfa635 (patch)
tree83198164e4e4a4477ac2e9e3d929e2ff5ee8fa09
parenteda3392f500f346a16d5d6b96d15e0269642310c (diff)
Fix for issue 3663 by returning early if no scan was started before stop is issued
-rw-r--r--ports/esp32s2/common-hal/wifi/Radio.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/ports/esp32s2/common-hal/wifi/Radio.c b/ports/esp32s2/common-hal/wifi/Radio.c
index 49cb8ec30..05506783e 100644
--- a/ports/esp32s2/common-hal/wifi/Radio.c
+++ b/ports/esp32s2/common-hal/wifi/Radio.c
@@ -105,6 +105,10 @@ mp_obj_t common_hal_wifi_radio_start_scanning_networks(wifi_radio_obj_t *self) {
}
void common_hal_wifi_radio_stop_scanning_networks(wifi_radio_obj_t *self) {
+ // Return early if self->current_scan is NULL to avoid hang
+ if (self->current_scan == NULL) {
+ return;
+ }
// Free the memory used to store the found aps.
wifi_scannednetworks_deinit(self->current_scan);
self->current_scan = NULL;