Skip to content

Commit 3f73dce

Browse files
author
Josh Holtz
committed
Merge pull request #20 from BenjaminDigeon/json-api-v1.0-final
BUGFIX : Crash in the parser if resource descriptor not defined
2 parents 1ef7f96 + b57846a commit 3f73dce

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Classes/JSONAPIResourceParser.m

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,10 @@ + (NSArray*)parseResources:(NSArray*)array {
6666

6767
NSMutableArray *mutableArray = @[].mutableCopy;
6868
for (NSDictionary *dictionary in array) {
69-
[mutableArray addObject:[self parseResource:dictionary]];
69+
NSObject <JSONAPIResource> *resource = [self parseResource:dictionary];
70+
if(resource) {
71+
[mutableArray addObject:[self parseResource:dictionary]];
72+
}
7073
}
7174

7275
return mutableArray;

0 commit comments

Comments
 (0)