Merge pull request #3819 from BennyE/issue3663

Fix for issue 3663 by returning early if no scan was started before s…
This commit is contained in:
Scott Shawcroft 2020-12-14 17:11:18 -08:00 committed by GitHub
commit a1f773d9ed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -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;