Don't throw an exception if doing a simple attribute mapping with a nil data source. closes #1005

This commit is contained in:
Blake Watters
2012-10-18 15:17:57 -04:00
parent f69c2976e2
commit e748e5bfce
2 changed files with 21 additions and 1 deletions

View File

@@ -650,7 +650,7 @@ static void RKSetIntermediateDictionaryValuesOnObjectForKeyPath(id object, NSStr
[self applyNestedMappings];
BOOL mappedSimpleAttributes = [self applyAttributeMappings:[self simpleAttributeMappings]];
BOOL mappedRelationships = [self applyRelationshipMappings];
BOOL mappedRelationships = [[self relationshipMappings] count] ? [self applyRelationshipMappings] : NO;
BOOL mappedKeyPathAttributes = [self applyAttributeMappings:[self keyPathAttributeMappings]];
if ((mappedSimpleAttributes || mappedKeyPathAttributes || mappedRelationships) && _validationError == nil) {
RKLogDebug(@"Finished mapping operation successfully...");