瀏覽代碼

fix crash when item without url is tried to be downloaded

Felix Paul Kühne 9 年之前
父節點
當前提交
2b31ef22c4
共有 1 個文件被更改,包括 9 次插入0 次删除
  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;