Skip to content

Commit

Permalink
avoid null pointer in cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisdecenzo committed Aug 25, 2022
1 parent 7e4e6a6 commit 656605e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/controller/CHIPDeviceController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1551,6 +1551,11 @@ void DeviceCommissioner::CommissioningStageComplete(CHIP_ERROR err, Commissionin
{
// Once this stage is complete, reset mDeviceBeingCommissioned - this will be reset when the delegate calls the next step.
MATTER_TRACE_EVENT_SCOPE("CommissioningStageComplete", "DeviceCommissioner");
if (mDeviceBeingCommissioned == nullptr)
{
ChipLogProgress(Controller, "CommissioningStageComplete with null mDeviceBeingCommissioned");
return;
}
NodeId nodeId = mDeviceBeingCommissioned->GetDeviceId();
DeviceProxy * proxy = mDeviceBeingCommissioned;
mDeviceBeingCommissioned = nullptr;
Expand Down

0 comments on commit 656605e

Please sign in to comment.