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) {
|
if (failure) {
|
||||||
failure(error);
|
failure(error);
|
||||||
}
|
}
|
||||||
|
} else if ([data length] == 0) {
|
||||||
|
if (success) {
|
||||||
|
success(nil);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
id JSON = nil;
|
id JSON = nil;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue