Permalink
Browse files

MTLManagedObjectAdapter: Fix a bug where errors are silently handled

It was using `error` but this error is replaced later in the method and never
passed as an error.

```objective-c
if (error != NULL) {
    *error = tmpError;
}
```
  • Loading branch information...
1 parent eb2178a commit e21c9c327cabcdf2ebef428bdcf2d8fab6c7b70f @kylef kylef committed Jan 24, 2014
Showing with 1 addition and 1 deletion.
  1. +1 −1 Mantle/MTLManagedObjectAdapter.m
@@ -392,7 +392,7 @@ - (id)managedObjectFromModel:(MTLModel<MTLManagedObjectSerializing> *)model inse
NSValueTransformer *attributeTransformer = [self entityAttributeTransformerForKey:propertyKey];
if (attributeTransformer != nil) transformedValue = [attributeTransformer transformedValue:transformedValue];
- if (![managedObject validateValue:&transformedValue forKey:managedObjectKey error:error]) return NO;
+ if (![managedObject validateValue:&transformedValue forKey:managedObjectKey error:&tmpError]) return NO;
[managedObject setValue:transformedValue forKey:managedObjectKey];
return YES;

0 comments on commit e21c9c3

Please sign in to comment.