Fix the issue when multiple request for same url failed, the completedBlock will callback more times
This commit is contained in:
parent
9cf8d125f5
commit
b25864cc71
|
@ -601,7 +601,8 @@ didReceiveResponse:(NSURLResponse *)response
|
|||
CGSize imageSize = image.size;
|
||||
if (imageSize.width == 0 || imageSize.height == 0) {
|
||||
NSString *description = image == nil ? @"Downloaded image decode failed" : @"Downloaded image has 0 pixels";
|
||||
[self callCompletionBlocksWithError:[NSError errorWithDomain:SDWebImageErrorDomain code:SDWebImageErrorBadImageData userInfo:@{NSLocalizedDescriptionKey : description}]];
|
||||
NSError *error = [NSError errorWithDomain:SDWebImageErrorDomain code:SDWebImageErrorBadImageData userInfo:@{NSLocalizedDescriptionKey : description}];
|
||||
[self callCompletionBlockWithToken:token image:nil imageData:nil error:error finished:YES];
|
||||
} else {
|
||||
[self callCompletionBlockWithToken:token image:image imageData:imageData error:nil finished:YES];
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue