diff options
author | ByteHamster <info@bytehamster.com> | 2021-09-17 18:15:04 +0200 |
---|---|---|
committer | ByteHamster <info@bytehamster.com> | 2021-09-17 18:15:12 +0200 |
commit | 669705f75d511ed6242ef86ffe94ca6f79b66eb6 (patch) | |
tree | 0cd69da9f419f51f738389a5421e56e9422ec22e /core | |
parent | 1e94fa59ea8419e21351c6c3ea6204589b03bb58 (diff) | |
download | AntennaPod-669705f75d511ed6242ef86ffe94ca6f79b66eb6.zip |
Fix NPE in duplicate detection
Diffstat (limited to 'core')
-rw-r--r-- | core/src/main/java/de/danoeh/antennapod/core/storage/DBTasks.java | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/core/src/main/java/de/danoeh/antennapod/core/storage/DBTasks.java b/core/src/main/java/de/danoeh/antennapod/core/storage/DBTasks.java index 9dd979dc7..30a22d595 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/storage/DBTasks.java +++ b/core/src/main/java/de/danoeh/antennapod/core/storage/DBTasks.java @@ -359,8 +359,11 @@ public final class DBTasks { && TextUtils.equals(item.getMedia().getStreamUrl(), searchItem.getMedia().getStreamUrl())) { return item; } else if (titlesLookSimilar(item.getTitle(), searchItem.getTitle())) { + if (searchItem.getPubDate() == null || item.getPubDate() == null) { + continue; + } long dateOriginal = item.getPubDate().getTime(); - long dateNew = searchItem.getPubDate() == null ? 0 : searchItem.getPubDate().getTime(); + long dateNew = searchItem.getPubDate().getTime(); if (Math.abs(dateOriginal - dateNew) < 7L * 24L * 3600L * 1000L) { // Same week return item; } |