From 1e4d6f20fc7e6b5e12bfc2946e6456cf1f247f11 Mon Sep 17 00:00:00 2001 From: Andres Amaya Garcia Date: Mon, 11 Jan 2016 09:32:59 +0000 Subject: [PATCH] Add initialization check before querying SD bond table --- source/btle/btle_security.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/source/btle/btle_security.cpp b/source/btle/btle_security.cpp index 41a4b9e..3567775 100644 --- a/source/btle/btle_security.cpp +++ b/source/btle/btle_security.cpp @@ -273,6 +273,9 @@ dm_handler(dm_handle_t const *p_handle, dm_event_t const *p_event, ret_code_t ev ble_error_t btle_createWhitelistFromBondTable(ble_gap_whitelist_t *p_whitelist) { + if (!btle_hasInitializedSecurity()) { + return BLE_ERROR_INITIALIZATION_INCOMPLETE; + } ret_code_t err = dm_whitelist_create(&applicationInstance, p_whitelist); if (err == NRF_SUCCESS) { return BLE_ERROR_NONE;