Skip to content

Commit

Permalink
don't to perform download if url is "" but not nil
Browse files Browse the repository at this point in the history
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
  • Loading branch information
initlifeinc committed Sep 30, 2015
1 parent 2d748f1 commit 5f0594f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion SDWebImage/SDWebImageManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ - (void)diskImageExistsForURL:(NSURL *)url
isFailedUrl = [self.failedURLs containsObject:url];
}

if (!url || (!(options & SDWebImageRetryFailed) && isFailedUrl)) {
if (url.absoluteString.length == 0 || (!(options & SDWebImageRetryFailed) && isFailedUrl)) {
dispatch_main_sync_safe(^{
NSError *error = [NSError errorWithDomain:NSURLErrorDomain code:NSURLErrorFileDoesNotExist userInfo:nil];
completedBlock(nil, error, SDImageCacheTypeNone, YES, url);
Expand Down

0 comments on commit 5f0594f

Please sign in to comment.