diff --git a/src/app/clusters/group-key-mgmt-server/group-key-mgmt-server.cpp b/src/app/clusters/group-key-mgmt-server/group-key-mgmt-server.cpp index fcd0dfa1353516..ff94013838c015 100644 --- a/src/app/clusters/group-key-mgmt-server/group-key-mgmt-server.cpp +++ b/src/app/clusters/group-key-mgmt-server/group-key-mgmt-server.cpp @@ -639,7 +639,7 @@ bool emberAfGroupKeyManagementClusterKeySetRemoveCallback( CHIP_ERROR err = provider->RemoveKeySet(fabricIndex, commandData.groupKeySetID); Status status = Status::Success; - if (CHIP_ERROR_KEY_NOT_FOUND == err) + if (CHIP_ERROR_NOT_FOUND == err || CHIP_ERROR_KEY_NOT_FOUND == err) { status = Status::NotFound; } diff --git a/src/app/tests/suites/TestGroupKeyManagementCluster.yaml b/src/app/tests/suites/TestGroupKeyManagementCluster.yaml index 82e10bc2120374..8de9d5e1134020 100644 --- a/src/app/tests/suites/TestGroupKeyManagementCluster.yaml +++ b/src/app/tests/suites/TestGroupKeyManagementCluster.yaml @@ -1114,3 +1114,14 @@ tests: attribute: "GroupKeyMap" response: value: [] + + - label: "TH tries to remove a non-existent key" + cluster: "Group Key Management" + endpoint: 0 + command: "KeySetRemove" + arguments: + values: + - name: "GroupKeySetID" + value: 0x0111 + response: + error: NOT_FOUND