diff --git a/source/nRF5xSecurityManager.h b/source/nRF5xSecurityManager.h index 2fa7b05..c1629f7 100644 --- a/source/nRF5xSecurityManager.h +++ b/source/nRF5xSecurityManager.h @@ -74,9 +74,12 @@ public: ble_error_t error = createWhitelistFromBondTable(whitelistFromBondTable); if (error != BLE_ERROR_NONE) { addresses.size = 0; + addresses.bonds = 0; return error; } + addresses.bonds = whitelistFromBondTable.irk_count; + /* Put all the addresses in the structure */ for (i = 0; i < whitelistFromBondTable.addr_count; ++i) { if (i >= addresses.capacity) {