Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix DisarmDone commissionee misssing null check #22146

Merged
merged 3 commits into from
Aug 29, 2022
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/controller/CHIPDeviceController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1511,12 +1511,13 @@ void DeviceCommissioner::DisarmDone()
// to do here.
VerifyOrReturn(mDeviceBeingCommissioned != nullptr);

NodeId nodeId = mDeviceBeingCommissioned->GetDeviceId();
// At this point, we also want to close off the pase session so we need to re-establish
CommissioneeDeviceProxy * commissionee = FindCommissioneeDevice(mDeviceBeingCommissioned->GetDeviceId());
CommissioneeDeviceProxy * commissionee = FindCommissioneeDevice(nodeId);

// Signal completion - this will reset mDeviceBeingCommissioned.
CommissioningStageComplete(CHIP_NO_ERROR);
SendCommissioningCompleteCallbacks(commissionee->GetDeviceId(), commissioningCompletionStatus);
SendCommissioningCompleteCallbacks(nodeId, commissioningCompletionStatus);

// If we've disarmed the failsafe, it's because we're starting again, so kill the pase connection.
if (commissionee != nullptr)
Expand Down