Bläddra i källkod

fix crash when item without url is tried to be downloaded

Felix Paul Kühne 9 år sedan
förälder
incheckning
2b31ef22c4
1 ändrade filer med 9 tillägg och 0 borttagningar
  1. 9 0
      SharedSources/ServerBrowsing/VLCServerBrowsingController.m

+ 9 - 0
SharedSources/ServerBrowsing/VLCServerBrowsingController.m

@@ -230,6 +230,15 @@
 #if DOWNLOAD_SUPPORTED
 - (BOOL)triggerDownloadForItem:(id<VLCNetworkServerBrowserItem>)item
 {
+    // is item supposed to be not downloadable?
+    if ([item respondsToSelector:@selector(isDownloadable)] && ![item isDownloadable]) {
+        return NO;
+    }
+    // if the item has no URL we can't download it
+    if (!item.URL) {
+        return NO;
+    }
+
     if (item.fileSizeBytes.longLongValue  < [[UIDevice currentDevice] freeDiskspace].longLongValue) {
         [self _downloadItem:item];
         return YES;