From daee12d62357e499fb9ea31317efea18d247312d Mon Sep 17 00:00:00 2001 From: Vincent Coubard Date: Tue, 27 Nov 2018 15:29:52 +0000 Subject: [PATCH] BLE: Fix set check in GenerigGap::stopAdvertising. --- features/FEATURE_BLE/source/generic/GenericGap.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/features/FEATURE_BLE/source/generic/GenericGap.cpp b/features/FEATURE_BLE/source/generic/GenericGap.cpp index a4928a07df..70e2390239 100644 --- a/features/FEATURE_BLE/source/generic/GenericGap.cpp +++ b/features/FEATURE_BLE/source/generic/GenericGap.cpp @@ -2357,7 +2357,11 @@ ble_error_t GenericGap::stopAdvertising(advertising_handle_t handle) return BLE_ERROR_INVALID_PARAM; } - if (_existing_sets.get(handle)) { + if (!_existing_sets.get(handle)) { + return BLE_ERROR_INVALID_PARAM; + } + + if (!_active_sets.get(handle)) { return BLE_ERROR_INVALID_PARAM; }