Skip to content

Commit b57846a

Browse files
BUGFIX : If an ressource descriptor is not defined for a ressource the parser should not be crashing
See : #19
1 parent 12b08a4 commit b57846a

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)