Skip to content

Commit

Permalink
Groups Cluster: AddGroup bugfix. (#22429)
Browse files Browse the repository at this point in the history
  • Loading branch information
rcasallas-silabs authored and pull[bot] committed Dec 14, 2023
1 parent 73cccfb commit 1431201
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions src/app/clusters/groups-server/groups-server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,17 +90,16 @@ static bool KeyExists(FabricIndex fabricIndex, GroupId groupId)

auto it = provider->IterateGroupKeys(fabricIndex);
bool found = false;
while (it->Next(entry) && !found)
while (!found && it->Next(entry))
{
found = (entry.group_id == groupId);
if (entry.group_id == groupId)
{
GroupDataProvider::KeySet keys;
found = (CHIP_NO_ERROR == provider->GetKeySet(fabricIndex, entry.keyset_id, keys));
}
}
it->Release();

if (found)
{
GroupDataProvider::KeySet keys;
found = (CHIP_NO_ERROR == provider->GetKeySet(fabricIndex, entry.keyset_id, keys));
}
return found;
}

Expand Down

0 comments on commit 1431201

Please sign in to comment.