Fixed NPE when loading ogg chapters

This commit is contained in:
ByteHamster 2021-02-16 16:09:18 +01:00
parent 3f1c1c4bf5
commit 9e68b8b0a3
1 changed files with 3 additions and 0 deletions

View File

@ -112,6 +112,9 @@ public class ChapterUtils {
VorbisCommentChapterReader reader = new VorbisCommentChapterReader(); VorbisCommentChapterReader reader = new VorbisCommentChapterReader();
reader.readInputStream(input); reader.readInputStream(input);
List<Chapter> chapters = reader.getChapters(); List<Chapter> chapters = reader.getChapters();
if (chapters == null) {
return Collections.emptyList();
}
Collections.sort(chapters, new ChapterStartTimeComparator()); Collections.sort(chapters, new ChapterStartTimeComparator());
enumerateEmptyChapterTitles(chapters); enumerateEmptyChapterTitles(chapters);
if (chaptersValid(chapters)) { if (chaptersValid(chapters)) {