Call success with nil if response data has length == 0.
Fixes exception when attempting to parse empty response data (i.e. HTTP Status Code 204 No Content).
This commit is contained in:
parent
065ee0226f
commit
fa0297f1b8
1 changed files with 4 additions and 0 deletions
|
|
@ -61,6 +61,10 @@
|
|||
if (failure) {
|
||||
failure(error);
|
||||
}
|
||||
} else if ([data length] == 0) {
|
||||
if (success) {
|
||||
success(nil);
|
||||
}
|
||||
} else {
|
||||
id JSON = nil;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue