don't to perform download if url is "" but not nil
sometimes user may pass @"" as url to sdwebimage to download, now it will also run NSURLConnection and try to download, actually there is no need to do this. I think maybe use url.absoluteString.length == 0 to avoid that url is not nil but a empty string will be better
Showing
1 changed file
with
1 additions
and
1 deletions
@@ -133,7 +133,7 @@ | @@ -133,7 +133,7 @@ | ||
133 | isFailedUrl = [self.failedURLs containsObject:url]; | 133 | isFailedUrl = [self.failedURLs containsObject:url]; |
134 | } | 134 | } |
135 | 135 | ||
136 | - if (!url || (!(options & SDWebImageRetryFailed) && isFailedUrl)) { | 136 | + if (url.absoluteString.length == 0 || (!(options & SDWebImageRetryFailed) && isFailedUrl)) { |
137 | dispatch_main_sync_safe(^{ | 137 | dispatch_main_sync_safe(^{ |
138 | NSError *error = [NSError errorWithDomain:NSURLErrorDomain code:NSURLErrorFileDoesNotExist userInfo:nil]; | 138 | NSError *error = [NSError errorWithDomain:NSURLErrorDomain code:NSURLErrorFileDoesNotExist userInfo:nil]; |
139 | completedBlock(nil, error, SDImageCacheTypeNone, YES, url); | 139 | completedBlock(nil, error, SDImageCacheTypeNone, YES, url); |
-
Please register or login to post a comment