From 43144328a1475030875a12ef2862f3f1730441d2 Mon Sep 17 00:00:00 2001 From: C Freeman Date: Fri, 28 May 2021 11:22:23 -0400 Subject: [PATCH] Fix resolve on BLE from ip network commissioning. (#7213) IP network provisioning was incorrectly early-returning from the resolve callback and not sending data through to the python stack for BLE. --- src/controller/CHIPDeviceController.cpp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/controller/CHIPDeviceController.cpp b/src/controller/CHIPDeviceController.cpp index 71856925135fee..f23e186f6fb2a9 100644 --- a/src/controller/CHIPDeviceController.cpp +++ b/src/controller/CHIPDeviceController.cpp @@ -1527,15 +1527,13 @@ void BasicFailure(void * context, uint8_t status) void DeviceCommissioner::OnNodeIdResolved(const chip::Mdns::ResolvedNodeData & nodeData) { Device * device = nullptr; - if (mDeviceBeingPaired >= kNumMaxActiveDevices) - { - return; - } - - device = &mActiveDevices[mDeviceBeingPaired]; - if (device->GetDeviceId() == nodeData.mPeerId.GetNodeId() && mCommissioningStage == CommissioningStage::kFindOperational) + if (mDeviceBeingPaired < kNumMaxActiveDevices) { - AdvanceCommissioningStage(CHIP_NO_ERROR); + device = &mActiveDevices[mDeviceBeingPaired]; + if (device->GetDeviceId() == nodeData.mPeerId.GetNodeId() && mCommissioningStage == CommissioningStage::kFindOperational) + { + AdvanceCommissioningStage(CHIP_NO_ERROR); + } } DeviceController::OnNodeIdResolved(nodeData); }