Skip to content

Commit 402f5d1

Browse files
committed
Change FindCommissionedDevice timing
1 parent 4c4ab1d commit 402f5d1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/controller/CHIPDeviceController.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -1830,7 +1830,6 @@ void DeviceCommissioner::CleanupCommissioning(DeviceProxy * proxy, NodeId nodeId
18301830

18311831
if (completionStatus.err == CHIP_NO_ERROR)
18321832
{
1833-
CommissioneeDeviceProxy * commissionee = FindCommissioneeDevice(nodeId);
18341833
// CommissioningStageComplete uses mDeviceBeingCommissioned, which can
18351834
// be commissionee if we are cleaning up before we've gone operational. Normally
18361835
// that would not happen in this non-error case, _except_ if we were told to skip sending
@@ -1843,6 +1842,8 @@ void DeviceCommissioner::CleanupCommissioning(DeviceProxy * proxy, NodeId nodeId
18431842
// when called in the cleanup stage (which is where we are), and StopPairing does not directly release
18441843
// mDeviceBeingCommissioned.
18451844
CommissioningStageComplete(CHIP_NO_ERROR);
1845+
1846+
CommissioneeDeviceProxy * commissionee = FindCommissioneeDevice(nodeId);
18461847
if (commissionee != nullptr)
18471848
{
18481849
ReleaseCommissioneeDevice(commissionee);

0 commit comments

Comments
 (0)