Do not check request response status code when the protocol isn't HTTP (fix #110)
Showing
1 changed file
with
1 additions
and
1 deletions
@@ -115,7 +115,7 @@ NSString *const SDWebImageDownloadStopNotification = @"SDWebImageDownloadStopNot | @@ -115,7 +115,7 @@ NSString *const SDWebImageDownloadStopNotification = @"SDWebImageDownloadStopNot | ||
115 | 115 | ||
116 | - (void)connection:(NSURLConnection *)aConnection didReceiveResponse:(NSURLResponse *)response | 116 | - (void)connection:(NSURLConnection *)aConnection didReceiveResponse:(NSURLResponse *)response |
117 | { | 117 | { |
118 | - if ([((NSHTTPURLResponse *)response) statusCode] >= 400) | 118 | + if ([response respondsToSelector:@selector(statusCode)] && [((NSHTTPURLResponse *)response) statusCode] >= 400) |
119 | { | 119 | { |
120 | [aConnection cancel]; | 120 | [aConnection cancel]; |
121 | 121 |
-
Please register or login to post a comment