From 9607577b249f4d6427b580bcb20ec0b3cd5ff3ed Mon Sep 17 00:00:00 2001 From: Evgeny Trushkin Date: Fri, 18 Oct 2024 10:38:07 +0300 Subject: [PATCH] Fix OnPairingComplete is not called if pairing code is wrong --- src/controller/CHIPDeviceController.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/controller/CHIPDeviceController.cpp b/src/controller/CHIPDeviceController.cpp index 346867226e4261..6d14b17bc93519 100644 --- a/src/controller/CHIPDeviceController.cpp +++ b/src/controller/CHIPDeviceController.cpp @@ -1141,11 +1141,10 @@ void DeviceCommissioner::RendezvousCleanup(CHIP_ERROR status) // for IP commissioning, we have taken a reference to the // operational node to send the completion command. ReleaseCommissioneeDevice(mDeviceInPASEEstablishment); - - if (mPairingDelegate != nullptr) - { - mPairingDelegate->OnPairingComplete(status); - } + } + if (CHIP_NO_ERROR != status && mPairingDelegate != nullptr) + { + mPairingDelegate->OnPairingComplete(status); } }