Code cleanup: **error may be null as per coding standards in 'Creating and Returning NSError Objects' (found with Analyzer)

This commit is contained in:
Victor Kryukov
2011-06-18 15:55:39 +04:00
committed by Blake Watters
parent 5eb654b76a
commit 00ee7e93c3
2 changed files with 3 additions and 3 deletions

View File

@@ -153,7 +153,7 @@
RKLogError(@"Encountered errors during mapping: %@", [[mapper.errors valueForKey:@"localizedDescription"] componentsJoinedByString:@", "]);
// TODO: Construct a composite error that wraps up all the other errors
*error = [mapper.errors lastObject];
if (error) *error = [mapper.errors lastObject];
return nil;
}

View File

@@ -16,7 +16,7 @@
SBJsonParser* parser = [[SBJsonParser alloc] init];
id result = [parser objectWithString:string];
if (nil == result) {
*error = [[parser errorTrace] lastObject];
if (error) *error = [[parser errorTrace] lastObject];
}
[parser release];
@@ -27,7 +27,7 @@
SBJsonWriter *jsonWriter = [SBJsonWriter new];
NSString *json = [jsonWriter stringWithObject:self];
if (!json) {
*error = [[jsonWriter errorTrace] lastObject];
if (error) *error = [[jsonWriter errorTrace] lastObject];
}
[jsonWriter release];
return json;