diff --git a/JSONKit.m b/JSONKit.m index 520b4be..33f9fa6 100644 --- a/JSONKit.m +++ b/JSONKit.m @@ -995,6 +995,8 @@ static void _JKDictionaryRemoveObjectWithEntry(JKDictionary *dictionary, JKHashT static void _JKDictionaryAddObject(JKDictionary *dictionary, NSUInteger keyHash, id key, id object) { NSCParameterAssert((dictionary != NULL) && (key != NULL) && (object != NULL) && (dictionary->count < dictionary->capacity) && (dictionary->entry != NULL)); + if (object == [NSNull null]) { CFRelease(key); CFRelease(object); return; } + NSUInteger keyEntry = keyHash % dictionary->capacity, idx = 0UL; for(idx = 0UL; idx < dictionary->capacity; idx++) { NSUInteger entryIdx = (keyEntry + idx) % dictionary->capacity;