瀏覽代碼

local network: fix out of bounds exception

Felix Paul Kühne 11 年之前
父節點
當前提交
178529f9b7
共有 1 個文件被更改,包括 6 次插入3 次删除
  1. 6 3
      Sources/VLCLocalServerFolderListViewController.m

+ 6 - 3
Sources/VLCLocalServerFolderListViewController.m

@@ -216,8 +216,10 @@
             }
             NSArray *uriCollectionObjects = [[mediaItem uriCollection] allValues];
 
-            itemURL = [NSURL URLWithString:uriCollectionObjects[correctIndex]];
-            cell.downloadURL = itemURL;
+            if (uriCollectionObjects.count > 0) {
+                itemURL = [NSURL URLWithString:uriCollectionObjects[correctIndex]];
+                cell.downloadURL = itemURL;
+            }
 
             if (mediaSize < 1)
                 mediaSize = [mediaItem.size longLongValue];
@@ -312,7 +314,8 @@
             }
             NSArray *uriCollectionObjects = [[mediaItem uriCollection] allValues];
 
-            itemURL = [NSURL URLWithString:uriCollectionObjects[correctIndex]];
+            if (uriCollectionObjects.count > 0)
+                itemURL = [NSURL URLWithString:uriCollectionObjects[correctIndex]];
             if (itemURL) {
                 VLCAppDelegate* appDelegate = [UIApplication sharedApplication].delegate;
                 [appDelegate openMovieFromURL:itemURL];