Bladeren bron

fix runtime exception

(cherry picked from commit 1acc1ef85cbbaed808550cf79ab0367fa26b4492)
Felix Paul Kühne 9 jaren geleden
bovenliggende
commit
1ab9d9fa45
1 gewijzigde bestanden met toevoegingen van 5 en 2 verwijderingen
  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;