소스 검색

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;