Fixed crashing when importing data with a different than expected type #243

Closed
wants to merge 1 commit into
from
@@ -51,7 +51,12 @@ - (void) MR_setAttributes:(NSDictionary *)attributes forKeysWithDictionary:(id)o
id value = [attributeInfo MR_valueForKeyPath:lookupKeyPath fromObjectData:objectData];
if (![self MR_importValue:value forKey:attributeName])
{
- [self setValue:value forKey:attributeName];
+ @try {
+ [self setValue:value forKey:attributeName];
+ }
+ @catch (NSException *exception) {
+ NSLog(@"Couldn't import value: %@", exception.reason);
+ }
}
}
}