From b6ea08b6037cfbf64ee1648287d4ede81c490792 Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Thu, 8 Oct 2009 21:21:06 +0000 Subject: [PATCH] I hate NSNull. --- Library.mm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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; } -- 2.45.2