File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -120,10 +120,16 @@ - (void)prefetchURLs:(NSArray *)urls progress:(SDWebImagePrefetcherProgressBlock
120120 self.completionBlock = completionBlock;
121121 self.progressBlock = progressBlock;
122122
123- // Starts prefetching from the very first image on the list with the max allowed concurrency
124- NSUInteger listCount = self.prefetchURLs .count ;
125- for (NSUInteger i = 0 ; i < self.maxConcurrentDownloads && self.requestedCount < listCount; i++) {
126- [self startPrefetchingAtIndex: i];
123+ if (urls.count == 0 ){
124+ if (completionBlock){
125+ completionBlock (0 ,0 );
126+ }
127+ }else {
128+ // Starts prefetching from the very first image on the list with the max allowed concurrency
129+ NSUInteger listCount = self.prefetchURLs .count ;
130+ for (NSUInteger i = 0 ; i < self.maxConcurrentDownloads && self.requestedCount < listCount; i++) {
131+ [self startPrefetchingAtIndex: i];
132+ }
127133 }
128134}
129135
You can’t perform that action at this time.
0 commit comments