Fix the logic to check loaders. Find the correct loader first and then check if optional protocol method is implemented
This commit is contained in:
parent
fa426f9b05
commit
691873117a
|
@ -103,11 +103,12 @@
|
|||
- (BOOL)shouldBlockFailedURLWithURL:(NSURL *)url error:(NSError *)error {
|
||||
NSArray<id<SDImageLoader>> *loaders = self.loaders;
|
||||
for (id<SDImageLoader> loader in loaders.reverseObjectEnumerator) {
|
||||
if (![loader respondsToSelector:@selector(shouldBlockFailedURLWithURL:error:)]) {
|
||||
break;
|
||||
}
|
||||
if ([loader canRequestImageForURL:url]) {
|
||||
return [loader shouldBlockFailedURLWithURL:url error:error];
|
||||
if ([loader respondsToSelector:@selector(shouldBlockFailedURLWithURL:error:)]) {
|
||||
return [loader shouldBlockFailedURLWithURL:url error:error];
|
||||
} else {
|
||||
return NO;
|
||||
}
|
||||
}
|
||||
}
|
||||
return NO;
|
||||
|
|
Loading…
Reference in New Issue