Commit 45a5cb75 by Dima Bart

Fix error being populated on empty successful response.

parent f1412624
......@@ -612,7 +612,9 @@ NSString *const BUYClientCustomerAccessToken = @"X-Shopify-Customer-Access-Token
json = [NSJSONSerialization JSONObjectWithData:data options:0 error:nil];
}
if (!error) {
NSInteger statusCode = [(NSHTTPURLResponse *)response statusCode];
BOOL isSuccessful = (statusCode / 100) == 2;
if (!isSuccessful && !error) { // Only generate error if request failed
error = [self errorFromJSON:json response:response];
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment