Skip to content

Commit 7d9c93f

Browse files
author
Dale Buckley
committed
SDWebImage#406 - Fixed a problem where hitting a failed URL more than once wouldn't call the completion block
1 parent d04fd47 commit 7d9c93f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

SDWebImage/SDWebImageManager.m

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,11 @@ - (NSString *)cacheKeyForURL:(NSURL *)url
9191

9292
if (!url || !completedBlock || (!(options & SDWebImageRetryFailed) && isFailedUrl))
9393
{
94-
if (completedBlock) completedBlock(nil, nil, SDImageCacheTypeNone, NO);
94+
if (completedBlock)
95+
{
96+
NSError *error = [NSError errorWithDomain:NSURLErrorDomain code:NSURLErrorFileDoesNotExist userInfo:nil];
97+
completedBlock(nil, error, SDImageCacheTypeNone, YES);
98+
}
9599
return operation;
96100
}
97101

0 commit comments

Comments
 (0)