watch for empty getMedia() while checking for duplicates (#5274)

This commit is contained in:
Tony Tam 2021-07-17 01:23:40 -07:00 committed by GitHub
parent f73d64530a
commit 0b583e4527
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 5 deletions

View File

@ -345,12 +345,12 @@ public final class DBTasks {
}
// Did not find item with same ID. Try to guess duplicates based on other metadata.
for (FeedItem item : feed.getItems()) {
if (item.getMedia() == null || TextUtils.isEmpty(item.getMedia().getStreamUrl())) {
continue;
}
boolean isDuplicate = false;
if (TextUtils.equals(item.getMedia().getStreamUrl(), searchItem.getMedia().getStreamUrl())) {
if ((item.getMedia() != null)
&& (searchItem.getMedia() != null)
&& !TextUtils.isEmpty(item.getMedia().getStreamUrl())
&& !TextUtils.isEmpty(searchItem.getMedia().getStreamUrl())
&& TextUtils.equals(item.getMedia().getStreamUrl(), searchItem.getMedia().getStreamUrl())) {
Log.d(TAG, "Removing duplicate episode stream url " + item.getMedia().getStreamUrl());
isDuplicate = true;
} else if (TextUtils.equals(item.getTitle(), searchItem.getTitle())