diff options
author | orionlee <orionlee@yahoo.com> | 2019-01-10 12:11:55 -0800 |
---|---|---|
committer | orionlee <orionlee@yahoo.com> | 2019-04-06 13:43:11 -0700 |
commit | 1655d234af478fb69fcaecd504b41a39039fd133 (patch) | |
tree | 2fe58723ada4d666e91d7bef8054add07ef064fd /core/src/main/java | |
parent | 0472bb9237bd461a30f93c962d3dc9c8fdb7d4cd (diff) | |
download | AntennaPod-1655d234af478fb69fcaecd504b41a39039fd133.zip |
#2966 RxJava2 null - case the underlying method may return null, but
should never happen in the code path, e.g.,
return the current FeedItem in ItemFragment UI.
Mark underlying method as @Nullable, and let observer's existing
onError() to handle null case
Rx observer : underlying sources marked as @Nullable
ItemFragment.load : .loadInBackground
MediaplayerActivity.checkFavorite : DBReader.getFeedItem
ItemDescriptionFragment.onViewCreated : DBReader.getFeedItem
ItemlistFragment.loadItems : .loadData
Diffstat (limited to 'core/src/main/java')
-rw-r--r-- | core/src/main/java/de/danoeh/antennapod/core/storage/DBReader.java | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/core/src/main/java/de/danoeh/antennapod/core/storage/DBReader.java b/core/src/main/java/de/danoeh/antennapod/core/storage/DBReader.java index 86d2b8893..1b579f99a 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/storage/DBReader.java +++ b/core/src/main/java/de/danoeh/antennapod/core/storage/DBReader.java @@ -604,6 +604,7 @@ public final class DBReader { } } + @Nullable private static FeedItem getFeedItem(final long itemId, PodDBAdapter adapter) { Log.d(TAG, "Loading feeditem with id " + itemId); @@ -637,6 +638,7 @@ public final class DBReader { * @return The FeedItem or null if the FeedItem could not be found. All FeedComponent-attributes * as well as chapter marks of the FeedItem will also be loaded from the database. */ + @Nullable public static FeedItem getFeedItem(final long itemId) { Log.d(TAG, "getFeedItem() called with: " + "itemId = [" + itemId + "]"); @@ -649,6 +651,7 @@ public final class DBReader { } } + @Nullable private static FeedItem getFeedItem(final String podcastUrl, final String episodeUrl, PodDBAdapter adapter) { Log.d(TAG, "Loading feeditem with podcast url " + podcastUrl + " and episode url " + episodeUrl); Cursor cursor = null; |