Skip to content

Commit a1f773d

Browse files
authored
Merge pull request #3819 from BennyE/issue3663
Fix for issue 3663 by returning early if no scan was started before s…
2 parents dc473b2 + c5c1362 commit a1f773d

File tree

1 file changed

+4
-0
lines changed
  • ports/esp32s2/common-hal/wifi

1 file changed

+4
-0
lines changed

ports/esp32s2/common-hal/wifi/Radio.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,10 @@ mp_obj_t common_hal_wifi_radio_start_scanning_networks(wifi_radio_obj_t *self) {
105105
}
106106

107107
void common_hal_wifi_radio_stop_scanning_networks(wifi_radio_obj_t *self) {
108+
// Return early if self->current_scan is NULL to avoid hang
109+
if (self->current_scan == NULL) {
110+
return;
111+
}
108112
// Free the memory used to store the found aps.
109113
wifi_scannednetworks_deinit(self->current_scan);
110114
self->current_scan = NULL;

0 commit comments

Comments
 (0)