Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #212 from StyleShare/master

Fix a crash when key is null in mtl_valueMappingTransformer
  • Loading branch information...
commit 0e7dde3d7ae6b41ceabd185ac415807edab074ce 2 parents 43910cd + 3b860fd
@jspahrsummers jspahrsummers authored
2  Mantle/NSValueTransformer+MTLPredefinedTransformerAdditions.m
@@ -121,7 +121,7 @@ + (NSValueTransformer *)mtl_valueMappingTransformerWithDictionary:(NSDictionary
NSParameterAssert(dictionary.count == [[NSSet setWithArray:dictionary.allValues] count]);
return [MTLValueTransformer reversibleTransformerWithForwardBlock:^(id<NSCopying> key) {
- return dictionary[key];
+ return dictionary[key ?: NSNull.null];
} reverseBlock:^(id object) {
__block id result = nil;
[dictionary enumerateKeysAndObjectsUsingBlock:^(id key, id anObject, BOOL *stop) {
Please sign in to comment.
Something went wrong with that request. Please try again.