Fix null dereference static analyzer warnings

This commit is contained in:
Blake Watters
2012-09-27 11:47:30 -04:00
parent 82e4c1ba94
commit 458354484a
3 changed files with 6 additions and 3 deletions

View File

@@ -99,7 +99,7 @@
[mapperOperation start];
[mapperOperation waitUntilFinished];
if (mapperOperation.error) {
*error = mapperOperation.error;
if (error) *error = mapperOperation.error;
return nil;
}

View File

@@ -169,7 +169,10 @@ static NSIndexSet *RKObjectRequestOperationAcceptableMIMETypes()
mapperOperation.targetObject = self.targetObject;
[mapperOperation start];
[mapperOperation waitUntilFinished];
if (mapperOperation.error) *error = mapperOperation.error;
if (mapperOperation.error) {
if (error) *error = mapperOperation.error;
return nil;
}
return mapperOperation.mappingResult;
}

View File

@@ -225,7 +225,7 @@ NSError *RKErrorFromMappingResult(RKMappingResult *mappingResult)
RKMapperOperation *mapper = [[RKMapperOperation alloc] initWithObject:sourceObject mappingsDictionary:self.responseMappingsDictionary];
mapper.mappingOperationDataSource = dataSource;
[mapper start];
*error = mapper.error;
if (error) *error = mapper.error;
return mapper.mappingResult;
}