From: Jay Freeman (saurik) Date: Thu, 8 Oct 2009 21:21:06 +0000 (+0000) Subject: I hate NSNull. X-Git-Tag: v0.9.432~373 X-Git-Url: https://git.saurik.com/cycript.git/commitdiff_plain/b6ea08b6037cfbf64ee1648287d4ede81c490792 I hate NSNull. --- diff --git a/Library.mm b/Library.mm index bdcac75..aa65697 100644 --- a/Library.mm +++ b/Library.mm @@ -355,7 +355,7 @@ JSValueRef CYJSUndefined(JSContextRef context) { if (index < 0 || index >= static_cast([self count])) return [super cy$setProperty:name to:value]; else { - [self replaceObjectAtIndex:index withObject:value]; + [self replaceObjectAtIndex:index withObject:(value ?: [NSNull null])]; return true; } } @@ -403,7 +403,7 @@ JSValueRef CYJSUndefined(JSContextRef context) { @implementation NSMutableDictionary (Cycript) - (bool) cy$setProperty:(NSString *)name to:(NSObject *)value { - [self setObject:value forKey:name]; + [self setObject:(value ?: [NSNull null]) forKey:name]; return true; }