Skip to content
Permalink
Browse files

Merge branch 'null-relationship' of https://github.com/Sigmapoint/Mag…

…icalRecord into Sigmapoint-null-relationship
  • Loading branch information...
Coeur committed Jun 21, 2019
2 parents b91e55b + 990d68f commit ad79e25dc09cab76984e71947b9286919446f254
Showing with 7 additions and 1 deletion.
  1. +7 −1 MagicalRecord/Categories/NSManagedObject/NSManagedObject+MagicalDataImport.m
@@ -190,7 +190,7 @@ - (void)MR_setRelationships:(NSDictionary *)relationships forKeysWithObject:(id)
}
@finally
{
if (relatedObjectData == nil || [relatedObjectData isEqual:[NSNull null]])
if (relatedObjectData == nil)
{
continue;
}
@@ -210,6 +210,12 @@ - (void)MR_setRelationships:(NSDictionary *)relationships forKeysWithObject:(id)
continue;
}

if ([relatedObjectData isEqual:[NSNull null]])
{
[self setValue:nil forKey:relationshipName];
continue;
}

if ([relationshipInfo isToMany] && [relatedObjectData isKindOfClass:[NSArray class]])
{
for (id singleRelatedObjectData in relatedObjectData)

0 comments on commit ad79e25

Please sign in to comment.
You can’t perform that action at this time.