Skip to content

Commit ef40f83

Browse files
committed
Remove event handler before setting it to NULL
1 parent 9fc7118 commit ef40f83

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ports/nrf/common-hal/_bleio/Adapter.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -472,8 +472,8 @@ mp_obj_t common_hal_bleio_adapter_start_scan(bleio_adapter_obj_t *self, uint8_t*
472472
err_code = sd_ble_gap_scan_start(&scan_params, sd_data);
473473

474474
if (err_code != NRF_SUCCESS) {
475-
self->scan_results = NULL;
476475
ble_drv_remove_event_handler(scan_on_ble_evt, self->scan_results);
476+
self->scan_results = NULL;
477477
check_nrf_error(err_code);
478478
}
479479

0 commit comments

Comments
 (0)