diff --git a/nimble/host/src/ble_gap.c b/nimble/host/src/ble_gap.c index b3497eb2c..882984f02 100644 --- a/nimble/host/src/ble_gap.c +++ b/nimble/host/src/ble_gap.c @@ -2349,6 +2349,11 @@ ble_gap_rx_peroidic_adv_sync_estab(const struct ble_hci_ev_le_subev_periodic_adv BLE_HS_DBG_ASSERT(ble_gap_sync.psync); + if (!ble_gap_sync.psync) { + ble_hs_unlock(); + return; + } + if (!ev->status) { sync_handle = le16toh(ev->sync_handle);