Merge pull request #929 from kirualex/patch-2
Handle empty urls NSArray
This commit is contained in:
commit
d2da4d0df4
|
@ -120,10 +120,16 @@
|
||||||
self.completionBlock = completionBlock;
|
self.completionBlock = completionBlock;
|
||||||
self.progressBlock = progressBlock;
|
self.progressBlock = progressBlock;
|
||||||
|
|
||||||
// Starts prefetching from the very first image on the list with the max allowed concurrency
|
if(urls.count == 0){
|
||||||
NSUInteger listCount = self.prefetchURLs.count;
|
if(completionBlock){
|
||||||
for (NSUInteger i = 0; i < self.maxConcurrentDownloads && self.requestedCount < listCount; i++) {
|
completionBlock(0,0);
|
||||||
[self startPrefetchingAtIndex:i];
|
}
|
||||||
|
}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];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue