File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -200,16 +200,20 @@ + (void)set:(NSObject <JSONAPIResource> *)resource withDictionary:dictionary {
200
200
if (property.resourceType ) {
201
201
if (relationships) {
202
202
id value = [relationships objectForKey: [property jsonName ]];
203
- [resource setValue: [JSONAPIResourceParser jsonAPILink: value] forKey: key];
203
+ if (value[@" data" ] != [NSNull null ]) {
204
+ [resource setValue: [JSONAPIResourceParser jsonAPILink: value] forKey: key];
205
+ }
204
206
}
205
207
206
208
} else if (relationships[key]) {
207
209
if (relationships) {
208
210
id value = relationships[key];
209
- [resource setValue: [JSONAPIResourceParser jsonAPILink: value] forKey: key];
211
+ if (value[@" data" ] != [NSNull null ]) {
212
+ [resource setValue: [JSONAPIResourceParser jsonAPILink: value] forKey: key];
213
+ }
210
214
}
211
215
} else {
212
- id value = [attributes objectForKey: [property jsonName ]];;
216
+ id value = [attributes objectForKey: [property jsonName ]];
213
217
if ((id )[NSNull null ] == value) {
214
218
value = [dictionary objectForKey: [property jsonName ]];
215
219
}
You can’t perform that action at this time.
0 commit comments