Fix NullPointerException when chapter does not have start time (#6520)
This commit is contained in:
parent
7b5d366536
commit
8b7d3cabac
@ -1,5 +1,6 @@
|
|||||||
package de.danoeh.antennapod.parser.feed.namespace;
|
package de.danoeh.antennapod.parser.feed.namespace;
|
||||||
|
|
||||||
|
import android.text.TextUtils;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
import de.danoeh.antennapod.model.feed.Chapter;
|
import de.danoeh.antennapod.model.feed.Chapter;
|
||||||
@ -31,7 +32,8 @@ public class SimpleChapters extends Namespace {
|
|||||||
if (currentItem != null) {
|
if (currentItem != null) {
|
||||||
if (localName.equals(CHAPTERS)) {
|
if (localName.equals(CHAPTERS)) {
|
||||||
currentItem.setChapters(new ArrayList<>());
|
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 {
|
try {
|
||||||
long start = DateUtils.parseTimeString(attributes.getValue(START));
|
long start = DateUtils.parseTimeString(attributes.getValue(START));
|
||||||
String title = attributes.getValue(TITLE);
|
String title = attributes.getValue(TITLE);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user