We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3fabe51 commit 7fd5066Copy full SHA for 7fd5066
STNetTaskQueue/STHTTPNetTaskQueueHandler.m
@@ -179,8 +179,12 @@ - (void)URLSession:(NSURLSession *)session dataTask:(NSURLSessionDataTask *)data
179
180
- (void)URLSession:(NSURLSession *)session task:(NSURLSessionTask *)task didCompleteWithError:(NSError *)error
181
{
182
- NSData *data = [NSData dataWithData:_data];
183
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *)task.response;
+ if (!httpResponse) { // NSURLSessionTask is cancelled
184
+ return;
185
+ }
186
+
187
+ NSData *data = [NSData dataWithData:_data];
188
if (httpResponse.statusCode >= 200 && httpResponse.statusCode < 300) {
189
id responseObj = nil;
190
NSError *error = nil;
0 commit comments