diff --git a/src/controller/CHIPDeviceController.cpp b/src/controller/CHIPDeviceController.cpp index 929b42c92509f9..7bd3fe0e30915c 100644 --- a/src/controller/CHIPDeviceController.cpp +++ b/src/controller/CHIPDeviceController.cpp @@ -924,7 +924,10 @@ void DeviceCommissioner::OnSessionEstablished(const SessionHandle & session) ChipLogDetail(Controller, "Remote device completed SPAKE2+ handshake"); - mPairingDelegate->OnPairingComplete(CHIP_NO_ERROR); + if (mPairingDelegate != nullptr) + { + mPairingDelegate->OnPairingComplete(CHIP_NO_ERROR); + } if (mRunCommissioningAfterConnection) { diff --git a/src/controller/SetUpCodePairer.cpp b/src/controller/SetUpCodePairer.cpp index 12b6b3cf1e0bb5..0e72ddaeca3b3b 100644 --- a/src/controller/SetUpCodePairer.cpp +++ b/src/controller/SetUpCodePairer.cpp @@ -436,7 +436,10 @@ void SetUpCodePairer::OnPairingComplete(CHIP_ERROR error) mSystemLayer->CancelTimer(OnDeviceDiscoveredTimeoutCallback, this); ResetDiscoveryState(); - pairingDelegate->OnPairingComplete(error); + if (pairingDelegate != nullptr) + { + pairingDelegate->OnPairingComplete(error); + } return; } @@ -449,7 +452,10 @@ void SetUpCodePairer::OnPairingComplete(CHIP_ERROR error) return; } - pairingDelegate->OnPairingComplete(error); + if (pairingDelegate != nullptr) + { + pairingDelegate->OnPairingComplete(error); + } } void SetUpCodePairer::OnPairingDeleted(CHIP_ERROR error)