Skip to content

Commit

Permalink
Use of Missing optionnal when pin length is 0
Browse files Browse the repository at this point in the history
  • Loading branch information
lpbeliveau-silabs committed Nov 4, 2024
1 parent 6962345 commit 84682d1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion examples/lock-app/silabs/src/LockManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -264,8 +264,9 @@ void LockManager::UnlockAfterUnlatch()
bool succes = false;
if (mUnlatchContext.mEndpointId != kInvalidEndpointId)
{
Optional<chip::ByteSpan> pin = (mUnlatchContext.mPinLength) ? MakeOptional(chip::ByteSpan(mUnlatchContext.mPinBuffer, mUnlatchContext.mPinLength)): Optional<chip::ByteSpan>::Missing();
succes = setLockState(mUnlatchContext.mEndpointId, mUnlatchContext.mFabricIdx, mUnlatchContext.mNodeId,
DlLockState::kUnlocked, MakeOptional(chip::ByteSpan(mUnlatchContext.mPinBuffer, mUnlatchContext.mPinLength)), mUnlatchContext.mErr);
DlLockState::kUnlocked, pin, mUnlatchContext.mErr);
}

if (!succes)
Expand Down

0 comments on commit 84682d1

Please sign in to comment.