Skip to content

Commit c2108e2

Browse files
author
Josh Holtz
committed
Added check for nil for linker
1 parent 8b3a777 commit c2108e2

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

Classes/JSONAPI.m

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,10 @@ - (void)inflateWithDictionary:(NSDictionary*)dictionary {
112112
for (NSDictionary *resourceDictionary in value) {
113113
Class c = [JSONAPIResourceModeler resourceForLinkedType:[JSONAPIResourceLinker linkedType:key]];
114114
JSONAPIResource *resource = [JSONAPIResource jsonAPIResource:resourceDictionary withLinked:nil withClass:c];
115-
[resources setObject:resource forKey:resource.ID];
116-
117-
[linkedToLinkWithLinked addObject:resource];
115+
if (resource.ID != nil) {
116+
[resources setObject:resource forKey:resource.ID];
117+
[linkedToLinkWithLinked addObject:resource];
118+
}
118119
}
119120
[creatingLinked setObject:resources forKey:key];
120121

0 commit comments

Comments
 (0)