-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Description
code in EMSession lines 86-99 passes the wrong error variable when error is caused by an invalid http status code, causing a crash on the errorHandler if the code access the error variable.
// Parse response
NSError *err = nil;
NSInteger code = ((NSHTTPURLResponse *)response).statusCode;
if (code != 200) {
NSString *message = [NSString
stringWithFormat:@"Unexpected http status code %ld", (long)code];
ELOG(@"%@", message);
NSDictionary *d = @{NSLocalizedDescriptionKey : message};
err = [NSError errorWithDomain:EMErrorDomain
code:EMErrorBadHTTPStatus
userInfo:d];
errorHandler(error);
return;
}
variable passed to errorHandler should be err not error
Metadata
Metadata
Assignees
Labels
No labels