Check progressBlock is not nil before executing.
This commit is contained in:
parent
5f3e9272c8
commit
f2546c7333
|
@ -57,13 +57,17 @@
|
|||
self.finishedCount++;
|
||||
|
||||
if (image) {
|
||||
self.progressBlock(self.finishedCount,[self.prefetchURLs count]);
|
||||
if (self.progressBlock) {
|
||||
self.progressBlock(self.finishedCount,[self.prefetchURLs count]);
|
||||
}
|
||||
#ifdef SD_VERBOSE
|
||||
NSLog(@"Prefetched %d out of %d", self.finishedCount, self.prefetchURLs.count);
|
||||
#endif
|
||||
}
|
||||
else {
|
||||
self.progressBlock(self.finishedCount,[self.prefetchURLs count]);
|
||||
if (self.progressBlock) {
|
||||
self.progressBlock(self.finishedCount,[self.prefetchURLs count]);
|
||||
}
|
||||
#ifdef SD_VERBOSE
|
||||
NSLog(@"Prefetched %d out of %d (Failed)", self.finishedCount, [self.prefetchURLs count]);
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue