Skip to content
Browse files

handle blank string as nil

  • Loading branch information...
1 parent 905a1ed commit 74c520fe4114b94d46d666904aa207832b0f68ae @lavoy committed Jul 7, 2013
Showing with 7 additions and 0 deletions.
  1. +7 −0 ALToolkit/ALToolkit/NSDictionary+ALToolkitAdditions.m
View
7 ALToolkit/ALToolkit/NSDictionary+ALToolkitAdditions.m
@@ -20,6 +20,13 @@ - (id)safeObjectForKey:(NSString *)key class:(Class)class {
obj = [self objectForKey:key];
}
}
+
+ if (class == [NSString class]) {
+ if ([obj isEqualToString:@""]) {
+ obj = nil;
+ }
+ }
+
return obj;
}

0 comments on commit 74c520f

Please sign in to comment.
Something went wrong with that request. Please try again.