فهرست منبع

Fix runtime exception

(cherry picked from commit b4692d537ded4b79e433dbf0a09f30837ca4c6d3)
Felix Paul Kühne 9 سال پیش
والد
کامیت
cddcabb7f4
1فایلهای تغییر یافته به همراه4 افزوده شده و 1 حذف شده
  1. 4 1
      Sources/VLCLibraryViewController.m

+ 4 - 1
Sources/VLCLibraryViewController.m

@@ -777,7 +777,10 @@ static NSString *kUsingTableViewToShowData = @"UsingTableViewToShowData";
 - (UICollectionViewCell*)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath
 {
     VLCPlaylistCollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"PlaylistCell" forIndexPath:indexPath];
-    cell.mediaObject = _foundMedia[indexPath.row];
+    NSUInteger row = indexPath.row;
+    if (row < _foundMedia.count)
+        cell.mediaObject = _foundMedia[row];
+
     cell.collectionView = _collectionView;
 
     [cell setEditing:self.editing animated:NO];