Skip to content

Commit 1aa3f36

Browse files
author
Matthew York
committed
- Fixed bug that caused crash from absebt array
1 parent 46a3ff4 commit 1aa3f36

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

NSObject-ObjectMap/NSObject+ObjectMap.m

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,10 @@ +(NSArray *)arrayMapFromArray:(NSArray *)nestedArray forPropertyName:(NSString *
445445
// If it's an Array, recur
446446
if ([[nestedArray[xx] objectForKey:newKey] isKindOfClass:[NSArray class]]) {
447447
NSString *propertyType = [nestedObj valueForKeyPath:[NSString stringWithFormat:@"propertyArrayMap.%@", newKey]];
448-
[nestedObj setValue:[NSObject arrayMapFromArray:[nestedArray[xx] objectForKey:newKey] forPropertyName:propertyType] forKey:newKey];
448+
449+
if (propertyType) {
450+
[nestedObj setValue:[NSObject arrayMapFromArray:[nestedArray[xx] objectForKey:newKey] forPropertyName:propertyType] forKey:newKey];
451+
}
449452
}
450453
// If it's a Dictionary, create an object, and send to [self objectFromJSON]
451454
else if ([[nestedArray[xx] objectForKey:newKey] isKindOfClass:[NSDictionary class]]) {

0 commit comments

Comments
 (0)