summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpeking_ling <lingbjsz@gmail.com>2023-06-21 04:31:44 +0800
committerGitHub <noreply@github.com>2023-06-20 22:31:44 +0200
commit8b7d3cabac3f36de0b3e1cfb7f2976671dd5dadc (patch)
treed605eaaa8a3915ddc2ea8dc539a20d8180ecd493
parent7b5d366536b11f0829d4cdc447a015a8032e3179 (diff)
downloadAntennaPod-8b7d3cabac3f36de0b3e1cfb7f2976671dd5dadc.zip
Fix NullPointerException when chapter does not have start time (#6520)
-rw-r--r--parser/feed/src/main/java/de/danoeh/antennapod/parser/feed/namespace/SimpleChapters.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/parser/feed/src/main/java/de/danoeh/antennapod/parser/feed/namespace/SimpleChapters.java b/parser/feed/src/main/java/de/danoeh/antennapod/parser/feed/namespace/SimpleChapters.java
index dd116e189..67796d9bb 100644
--- a/parser/feed/src/main/java/de/danoeh/antennapod/parser/feed/namespace/SimpleChapters.java
+++ b/parser/feed/src/main/java/de/danoeh/antennapod/parser/feed/namespace/SimpleChapters.java
@@ -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);