mirror of
https://github.com/zhigang1992/RestKit.git
synced 2026-04-24 04:46:01 +08:00
Code cleanup: **error may be null as per coding standards in 'Creating and Returning NSError Objects' (found with Analyzer)
This commit is contained in:
committed by
Blake Watters
parent
5eb654b76a
commit
00ee7e93c3
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user