diff --git a/examples/lock-app/efr32/src/LockManager.cpp b/examples/lock-app/efr32/src/LockManager.cpp index d3728680eed7d0..a73663680590d0 100644 --- a/examples/lock-app/efr32/src/LockManager.cpp +++ b/examples/lock-app/efr32/src/LockManager.cpp @@ -363,12 +363,6 @@ bool LockManager::SetUser(chip::EndpointId endpointId, uint16_t userIndex, chip: bool LockManager::GetCredential(chip::EndpointId endpointId, uint16_t credentialIndex, DlCredentialType credentialType, EmberAfPluginDoorLockCredentialInfo & credential) const { - if ((credentialIndex < MIN_CREDENTIAL_INDEX) || (credentialIndex > MAX_CREDENTIAL_PER_USER)) - { - ChipLogError(Zcl, "Cannot get credential - credential index is out of range [endpoint=%d,index=%d]", endpointId, - credentialIndex); - return false; - } // door-lock-server checks for valid credential index uint16_t adjustedCredentialIndex = credentialIndex - 1; @@ -376,6 +370,14 @@ bool LockManager::GetCredential(chip::EndpointId endpointId, uint16_t credential ChipLogProgress(Zcl, "Lock App: LockManager::GetCredential [credentialType=%u], credentialIndex=%d", to_underlying(credentialType), adjustedCredentialIndex); + if (credentialType == DlCredentialType::kProgrammingPIN) + { + ChipLogError(Zcl, "Programming user not supported [credentialType=%u], credentialIndex=%d", to_underlying(credentialType), + adjustedCredentialIndex); + + return true; + } + const auto & credentialInStorage = mLockCredentials[adjustedCredentialIndex]; credential.status = credentialInStorage.status;