Don't crash if result is nil in model loader

This commit is contained in:
Jeremy Ellison
2010-07-12 10:43:44 -04:00
parent 0a79ae9488
commit 60dc618a84

View File

@@ -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) {