diff --git a/src/darwin/Framework/CHIP/MTRDevice.mm b/src/darwin/Framework/CHIP/MTRDevice.mm index 2e2acd3069aa6e..4014bd5f6924bf 100644 --- a/src/darwin/Framework/CHIP/MTRDevice.mm +++ b/src/darwin/Framework/CHIP/MTRDevice.mm @@ -3097,8 +3097,9 @@ - (void)_pruneClustersIn:(MTRDeviceDataValueDictionary)previousServerListValue NSMutableSet * clusterPathsToRemove = [[NSMutableSet alloc] init]; for (MTRClusterPath * path in _persistedClusters) { - if ([path.endpoint isEqualToNumber:endpointID] && [toBeRemovedClusters containsObject:path.cluster]) + if ([path.endpoint isEqualToNumber:endpointID] && [toBeRemovedClusters containsObject:path.cluster]) { [clusterPathsToRemove addObject:path]; + } } [self _removeClusters:clusterPathsToRemove doRemoveFromDataStore:YES]; }