Fix NullPointerException when chapter does not have start time (#6520)

This commit is contained in:
peking_ling 2023-06-21 04:31:44 +08:00 committed by GitHub
parent 7b5d366536
commit 8b7d3cabac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -1,5 +1,6 @@
package de.danoeh.antennapod.parser.feed.namespace;
import android.text.TextUtils;
import android.util.Log;
import de.danoeh.antennapod.model.feed.Chapter;
@ -31,7 +32,8 @@ public class SimpleChapters extends Namespace {
if (currentItem != null) {
if (localName.equals(CHAPTERS)) {
currentItem.setChapters(new ArrayList<>());
} else if (localName.equals(CHAPTER)) {
} else if (localName.equals(CHAPTER) && !TextUtils.isEmpty(attributes.getValue(START))) {
// if the chapter's START is empty, we don't need to do anything
try {
long start = DateUtils.parseTimeString(attributes.getValue(START));
String title = attributes.getValue(TITLE);