Merge pull request #929 from kirualex/patch-2

Handle empty urls NSArray
This commit is contained in:
Olivier Poitrey 2014-10-14 07:14:45 -07:00
commit d2da4d0df4
1 changed files with 10 additions and 4 deletions

View File

@ -120,11 +120,17 @@
self.completionBlock = completionBlock;
self.progressBlock = progressBlock;
if(urls.count == 0){
if(completionBlock){
completionBlock(0,0);
}
}else{
// Starts prefetching from the very first image on the list with the max allowed concurrency
NSUInteger listCount = self.prefetchURLs.count;
for (NSUInteger i = 0; i < self.maxConcurrentDownloads && self.requestedCount < listCount; i++) {
[self startPrefetchingAtIndex:i];
}
}
}
- (void)cancelPrefetching {