소스 검색

Fix runtime exception

(cherry picked from commit 4f76a13c0283183c3660565aa4ec6c9369a0493c)
Felix Paul Kühne 9 년 전
부모
커밋
d43ddc3a35
1개의 변경된 파일5개의 추가작업 그리고 1개의 파일을 삭제
  1. 5 1
      Apple-TV/Playback/Playback Info/VLCPlaybackInfoTracksTVViewController.m

+ 5 - 1
Apple-TV/Playback/Playback Info/VLCPlaybackInfoTracksTVViewController.m

@@ -117,7 +117,11 @@
 
 -(void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath
 {
-    self.mediaPlayer.currentAudioTrackIndex = [self.mediaPlayer.audioTrackIndexes[indexPath.row] intValue];
+    NSArray *audioTrackIndexes = self.mediaPlayer.audioTrackIndexes;
+    NSInteger row = indexPath.row;
+    if (row < audioTrackIndexes.count) {
+        self.mediaPlayer.currentAudioTrackIndex = [audioTrackIndexes[row] intValue];
+    }
     [collectionView reloadData];
 }