diff --git a/src/darwin/Framework/CHIPTests/MTRDeviceTests.m b/src/darwin/Framework/CHIPTests/MTRDeviceTests.m index e83a9599dc29be..5e781f83cadc06 100644 --- a/src/darwin/Framework/CHIPTests/MTRDeviceTests.m +++ b/src/darwin/Framework/CHIPTests/MTRDeviceTests.m @@ -717,18 +717,18 @@ - (void)test011_ReadCachedAttribute attributeReportHandler:^(NSArray * value) { NSLog(@"Received report: %@", value); if (reportHandler) { - __auto_type handler = reportHandler; - reportHandler = nil; - handler(value, nil); + __auto_type handler = reportHandler; + reportHandler = nil; + handler(value, nil); } } eventReportHandler:nil errorHandler:^(NSError * error) { NSLog(@"Received report error: %@", error); if (reportHandler) { - __auto_type handler = reportHandler; - reportHandler = nil; - handler(nil, error); + __auto_type handler = reportHandler; + reportHandler = nil; + handler(nil, error); } } subscriptionEstablished:^() {