소스 검색

Fix runtime exception

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

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

@@ -104,7 +104,11 @@
 {
     VLCPlaybackInfoTVCollectionViewCell *trackCell = (VLCPlaybackInfoTVCollectionViewCell*)cell;
     NSInteger row = indexPath.row;
-    BOOL isSelected = [self.mediaPlayer.audioTrackIndexes[row] intValue] == self.mediaPlayer.currentAudioTrackIndex;
+    BOOL isSelected = NO;
+    NSArray *audioTrackIndexes = self.mediaPlayer.audioTrackIndexes;
+    if (row < audioTrackIndexes.count) {
+        isSelected = [audioTrackIndexes[row] intValue] == self.mediaPlayer.currentAudioTrackIndex;
+    }
     trackCell.selectionMarkerVisible = isSelected;
 
     NSString *trackName = self.mediaPlayer.audioTrackNames[row];