mirror of
https://github.com/zhigang1992/RestKit.git
synced 2026-04-23 20:31:13 +08:00
Don't crash if result is nil in model loader
This commit is contained in:
@@ -133,7 +133,9 @@
|
||||
if ([result isKindOfClass:[NSArray class]]) {
|
||||
results = (NSArray*)result;
|
||||
} else {
|
||||
results = [NSArray arrayWithObject:result];
|
||||
// Using arrayWithObjects: instead of arrayWithObject:
|
||||
// so that in the event result is nil, then we get empty array instead of exception for trying to insert nil.
|
||||
results = [NSArray arrayWithObjects:result, nil];
|
||||
}
|
||||
|
||||
if (self.fetchRequest) {
|
||||
|
||||
Reference in New Issue
Block a user