From 7a09a12ef76041d88363d0e229c480119e609bca Mon Sep 17 00:00:00 2001 From: Nivedita Sarkar Date: Mon, 20 May 2024 13:28:00 -0700 Subject: [PATCH] Fix the check for the cluster paths --- src/darwin/Framework/CHIP/MTRDevice.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/darwin/Framework/CHIP/MTRDevice.mm b/src/darwin/Framework/CHIP/MTRDevice.mm index 0e3bacb743575f..7cc54c99162df7 100644 --- a/src/darwin/Framework/CHIP/MTRDevice.mm +++ b/src/darwin/Framework/CHIP/MTRDevice.mm @@ -2844,7 +2844,7 @@ - (void)_pruneOrphanedEndpointsAndClusters:(MTRAttributePath *)attributePath NSDictionary * dataStoreClusterData = [self.deviceController.controllerDataStore getStoredClusterDataForNodeID:self.nodeID]; NSMutableDictionary * dataStoreClusterDataCopy = [dataStoreClusterData mutableCopy]; for (MTRClusterPath * dataStorePath in dataStoreClusterData) { - if ([dataStorePath isEqualTo:path]) { + if ([dataStorePath.endpoint isEqualToNumber:path.endpoint] && [dataStorePath.cluster isEqualToNumber:path.cluster]) { [dataStoreClusterDataCopy removeObjectForKey:path]; [dataStoreClusterDataCopy setObject:clusterData forKey:path]; [self.deviceController.controllerDataStore storeClusterData:dataStoreClusterDataCopy forNodeID:self.nodeID];