Fix crash when attempting to map nil sourceKeyPath as identification attribute

This commit is contained in:
Blake Watters
2013-01-26 00:21:44 -05:00
parent 3e351509b3
commit d761de0ea7
3 changed files with 39 additions and 1 deletions

View File

@@ -316,7 +316,8 @@ static BOOL RKIsMetadataKVCInvocation(NSInvocation *invocation)
concreteMapping = (RKObjectMapping *)mapping;
}
return [self.dataSource mappingOperation:self targetObjectForRepresentation:representation withMapping:concreteMapping inRelationship:relationshipMapping];
NSDictionary *dictionaryRepresentation = [representation isKindOfClass:[NSDictionary class]] ? representation : @{ [NSNull null] : representation };
return [self.dataSource mappingOperation:self targetObjectForRepresentation:dictionaryRepresentation withMapping:concreteMapping inRelationship:relationshipMapping];
}
- (NSDate *)parseDateFromString:(NSString *)string