소스 검색

fix runtime exception

(cherry picked from commit 1acc1ef85cbbaed808550cf79ab0367fa26b4492)
Felix Paul Kühne 9 년 전
부모
커밋
1ab9d9fa45
1개의 변경된 파일5개의 추가작업 그리고 2개의 파일을 삭제
  1. 5 2
      Sources/VLCMovieViewController.m

+ 5 - 2
Sources/VLCMovieViewController.m

@@ -1222,8 +1222,11 @@ currentMediaHasTrackToChooseFrom:(BOOL)currentMediaHasTrackToChooseFrom
             if (row == mediaPlayer.currentTitleIndex)
                 cellShowsCurrentTrack = YES;
         } else {
-            NSDictionary *description = [mediaPlayer chapterDescriptionsOfTitle:mediaPlayer.currentTitleIndex][row];
-            cell.textLabel.text = [NSString stringWithFormat:@"%@ (%@)", description[VLCChapterDescriptionName], [[VLCTime timeWithNumber:description[VLCChapterDescriptionDuration]] stringValue]];
+            NSArray *chapterDescriptions = [mediaPlayer chapterDescriptionsOfTitle:mediaPlayer.currentTitleIndex];
+            if (row < chapterDescriptions.count) {
+                NSDictionary *description = chapterDescriptions[row];
+                cell.textLabel.text = [NSString stringWithFormat:@"%@ (%@)", description[VLCChapterDescriptionName], [[VLCTime timeWithNumber:description[VLCChapterDescriptionDuration]] stringValue]];
+            }
 
             if (row == mediaPlayer.currentChapterIndex)
                 cellShowsCurrentTrack = YES;