From ef90a8aa95fa89ed8afd146e90c33c0bdb8281a5 Mon Sep 17 00:00:00 2001 From: h2zero Date: Wed, 12 Jun 2024 09:28:43 -0600 Subject: [PATCH] Remove address from whitelist if the procedure fails. This prevents a situation where the whitelist contains the address but the procedure errors and the address cannot be added again. --- src/NimBLEDevice.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/NimBLEDevice.cpp b/src/NimBLEDevice.cpp index 97c2749..96563b3 100644 --- a/src/NimBLEDevice.cpp +++ b/src/NimBLEDevice.cpp @@ -691,6 +691,7 @@ bool NimBLEDevice::whiteListAdd(const NimBLEAddress & address) { int rc = ble_gap_wl_set(&wlVec[0], wlVec.size()); if (rc != 0) { NIMBLE_LOGE(LOG_TAG, "Failed adding to whitelist rc=%d", rc); + m_whiteList.pop_back(); return false; }