Skip to content

Commit

Permalink
project-chip#26925 update check for missing fabricIdx and nodeId
Browse files Browse the repository at this point in the history
  • Loading branch information
mmarc committed Jul 21, 2023
1 parent 8778bfd commit 91e5596
Showing 1 changed file with 5 additions and 13 deletions.
18 changes: 5 additions & 13 deletions src/app/clusters/door-lock-server/door-lock-server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,22 +128,14 @@ bool DoorLockServer::SetLockState(chip::EndpointId endpointId, DlLockState newLo
opType = LockOperationTypeEnum::kUnlatch;
}

if (OperationSourceEnum::kRemote == opSource)
if (OperationSourceEnum::kRemote == opSource && (fabricIdx.IsNull() || nodeId.IsNull()))
{
if (fabricIdx.IsNull() || nodeId.IsNull())
{
ChipLogError(Zcl, "Received SetLockState for remote operation without fabricIdx or nodeId");
}

SendLockOperationEvent(endpointId, opType, opSource, OperationErrorEnum::kUnspecified, userIndex, fabricIdx, nodeId,
credentials, success);
}
else
{
SendLockOperationEvent(endpointId, opType, opSource, OperationErrorEnum::kUnspecified, userIndex, NullNullable,
NullNullable, credentials, success);
ChipLogError(Zcl, "Received SetLockState for remote operation without fabricIdx or nodeId");
}

SendLockOperationEvent(endpointId, opType, opSource, OperationErrorEnum::kUnspecified, userIndex, fabricIdx, nodeId,
credentials, success);

// Reset wrong entry attempts (in case there were any incorrect credentials presented before) if lock/unlock was a success
// and a valid credential was presented.
if (success && !credentials.IsNull() && !(credentials.Value().empty()))
Expand Down

0 comments on commit 91e5596

Please sign in to comment.