Merge branch 'patch-1' of https://github.com/samsoffes/AFNetworking into samsoffes-patch-1
This commit is contained in:
commit
09401f9b66
1 changed files with 4 additions and 1 deletions
|
|
@ -355,7 +355,10 @@ static inline BOOL AFStateTransitionIsValid(AFOperationState fromState, AFOperat
|
||||||
[self.connection cancel];
|
[self.connection cancel];
|
||||||
|
|
||||||
// Manually send this delegate message since `[self.connection cancel]` causes the connection to never send another message to its delegate
|
// Manually send this delegate message since `[self.connection cancel]` causes the connection to never send another message to its delegate
|
||||||
NSDictionary *userInfo = [NSDictionary dictionaryWithObject:[self.request URL] forKey:NSURLErrorFailingURLErrorKey];
|
NSDictionary *userInfo = nil;
|
||||||
|
if (self.request.URL) {
|
||||||
|
userInfo = [NSDictionary dictionaryWithObject:[self.request URL] forKey:NSURLErrorFailingURLErrorKey];
|
||||||
|
}
|
||||||
[self performSelector:@selector(connection:didFailWithError:) withObject:self.connection withObject:[NSError errorWithDomain:NSURLErrorDomain code:NSURLErrorCancelled userInfo:userInfo]];
|
[self performSelector:@selector(connection:didFailWithError:) withObject:self.connection withObject:[NSError errorWithDomain:NSURLErrorDomain code:NSURLErrorCancelled userInfo:userInfo]];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue