Fix a number of warnings about potential dereference of null pointer

This commit is contained in:
Blake Watters
2012-10-02 15:52:20 -04:00
parent b41e56607a
commit 174372dcf5
4 changed files with 21 additions and 21 deletions

View File

@@ -222,11 +222,11 @@ NSString * const RKMappingTestVerificationFailureException = @"RKMappingTestVeri
NSString *description = [NSString stringWithFormat:@"mapped to unexpected %@ value '%@'", [event.value class], event.value];
NSString *reason = [NSString stringWithFormat:@"expected to %@, but instead got %@ '%@'",
expectation, [event.value class], event.value];
*error = [self errorForExpectation:expectation
withCode:RKMappingTestEvaluationBlockError
userInfo:userInfo
description:description
reason:reason];
if (error) *error = [self errorForExpectation:expectation
withCode:RKMappingTestEvaluationBlockError
userInfo:userInfo
description:description
reason:reason];
}
} else if (expectation.mapping) {
if ([event.propertyMapping isKindOfClass:[RKRelationshipMapping class]]) {
@@ -238,21 +238,21 @@ NSString * const RKMappingTestVerificationFailureException = @"RKMappingTestVeri
NSString *description = [NSString stringWithFormat:@"mapped using unexpected mapping: %@", relationshipMapping];
NSString *reason = [NSString stringWithFormat:@"expected to %@, but was instead mapped using: %@",
expectation, relationshipMapping];
*error = [self errorForExpectation:expectation
withCode:RKMappingTestEvaluationBlockError
userInfo:userInfo
description:description
reason:reason];
if (error) *error = [self errorForExpectation:expectation
withCode:RKMappingTestEvaluationBlockError
userInfo:userInfo
description:description
reason:reason];
}
} else {
NSString *description = [NSString stringWithFormat:@"expected a property mapping of type `RKRelationshipMapping` but instead got a `%@`", [expectation.mapping class]];
NSString *reason = [NSString stringWithFormat:@"expected to %@, but instead of a `RKRelationshipMapping` got a `%@`",
expectation, [expectation.mapping class]];
*error = [self errorForExpectation:expectation
withCode:RKMappingTestEvaluationBlockError
userInfo:userInfo
description:description
reason:reason];
if (error) *error = [self errorForExpectation:expectation
withCode:RKMappingTestEvaluationBlockError
userInfo:userInfo
description:description
reason:reason];
// Error message here that a relationship was not mapped!!!
return NO;