Pārlūkot izejas kodu

Thumbnail Cache: fix exception as NSCache doesn't like to store inexistant objects which can occur if libvlc didn't finish providing thumbnails yet

Felix Paul Kühne 11 gadi atpakaļ
vecāks
revīzija
62d356db9f
1 mainītis faili ar 2 papildinājumiem un 1 dzēšanām
  1. 2 1
      AspenProject/VLCThumbnailsCache.m

+ 2 - 1
AspenProject/VLCThumbnailsCache.m

@@ -39,7 +39,8 @@ static NSCache *_thumbnailCache;
         return displayedImage;
 
     displayedImage = mediaFile.computedThumbnail;
-    [_thumbnailCache setObject:displayedImage forKey:objID];
+    if (displayedImage)
+        [_thumbnailCache setObject:displayedImage forKey:objID];
 
     return displayedImage;
 }