tciuro / NanoStore

NanoStore is an open source, lightweight schema-less local key-value document store written in Objective-C for Mac OS X and iOS.
Other
404 stars 39 forks source link

+[NSFNanoObject NSObjectToJSONString:error:] improperly checks error parameter #81

Closed billgarrison closed 11 years ago

billgarrison commented 11 years ago

When an NSJSONSerialization error occurs, this method improperly checks whether the caller wants the serialization error.

At NSFNanoObject line 259:

+ (NSString *)_NSObjectToJSONString:(id)object error:(NSError **)error
{
    ...

    if (*error) {
        *error = tempError;
    }

    ...
}

This check should read:

    if (error != NULL) {
        *error = tempError;
    }
tciuro commented 11 years ago

Nice catch Bill! Much appreciated.