Merge pull request #261 from zole/fix-json-error-bug

Fixed bug with JSON decodes not returning errors
This commit is contained in:
Mattt Thompson 2012-03-20 14:50:28 -07:00
commit e87b3c1b6e

View file

@ -143,7 +143,7 @@ id AFJSONDecode(NSData *data, NSError **error) {
NSUInteger parseOptionFlags = 0; NSUInteger parseOptionFlags = 0;
[invocation setArgument:&parseOptionFlags atIndex:2]; // arguments 0 and 1 are self and _cmd respectively, automatically set by NSInvocation [invocation setArgument:&parseOptionFlags atIndex:2]; // arguments 0 and 1 are self and _cmd respectively, automatically set by NSInvocation
if (error != NULL) { if (error != NULL) {
[invocation setArgument:error atIndex:3]; [invocation setArgument:&error atIndex:3];
} }
[invocation invoke]; [invocation invoke];
@ -165,7 +165,7 @@ id AFJSONDecode(NSData *data, NSError **error) {
NSUInteger yajlParserOptions = 0; NSUInteger yajlParserOptions = 0;
[invocation setArgument:&yajlParserOptions atIndex:2]; // arguments 0 and 1 are self and _cmd respectively, automatically set by NSInvocation [invocation setArgument:&yajlParserOptions atIndex:2]; // arguments 0 and 1 are self and _cmd respectively, automatically set by NSInvocation
if (error != NULL) { if (error != NULL) {
[invocation setArgument:error atIndex:3]; [invocation setArgument:&error atIndex:3];
} }
[invocation invoke]; [invocation invoke];
@ -178,7 +178,7 @@ id AFJSONDecode(NSData *data, NSError **error) {
[invocation setArgument:&data atIndex:2]; // arguments 0 and 1 are self and _cmd respectively, automatically set by NSInvocation [invocation setArgument:&data atIndex:2]; // arguments 0 and 1 are self and _cmd respectively, automatically set by NSInvocation
if (error != NULL) { if (error != NULL) {
[invocation setArgument:error atIndex:3]; [invocation setArgument:&error atIndex:3];
} }
[invocation setArgument:&nullOption atIndex:4]; [invocation setArgument:&nullOption atIndex:4];
@ -196,7 +196,7 @@ id AFJSONDecode(NSData *data, NSError **error) {
NSUInteger readOptions = 0; NSUInteger readOptions = 0;
[invocation setArgument:&readOptions atIndex:3]; [invocation setArgument:&readOptions atIndex:3];
if (error != NULL) { if (error != NULL) {
[invocation setArgument:error atIndex:4]; [invocation setArgument:&error atIndex:4];
} }
[invocation invoke]; [invocation invoke];