From 427477b2562bd2ea8a4a3d6a01b923303c496e53 Mon Sep 17 00:00:00 2001 From: orionlee Date: Sun, 22 Sep 2019 11:03:09 -0700 Subject: [PATCH] #2929 - minor coding style tweaks per review --- .../de/danoeh/antennapod/activity/MediaplayerActivity.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/de/danoeh/antennapod/activity/MediaplayerActivity.java b/app/src/main/java/de/danoeh/antennapod/activity/MediaplayerActivity.java index c0af36d84..1b6fa6bce 100644 --- a/app/src/main/java/de/danoeh/antennapod/activity/MediaplayerActivity.java +++ b/app/src/main/java/de/danoeh/antennapod/activity/MediaplayerActivity.java @@ -394,7 +394,7 @@ public abstract class MediaplayerActivity extends CastEnabledActivity implements final FeedItem feedItem = getFeedItem(media); // some options option requires FeedItem switch (item.getItemId()) { case R.id.add_to_favorites_item: - if(feedItem != null) { + if (feedItem != null) { DBWriter.addFavoriteItem(feedItem); isFavorite = true; invalidateOptionsMenu(); @@ -403,7 +403,7 @@ public abstract class MediaplayerActivity extends CastEnabledActivity implements } break; case R.id.remove_from_favorites_item: - if(feedItem != null) { + if (feedItem != null) { DBWriter.removeFavoriteItem(feedItem); isFavorite = false; invalidateOptionsMenu(); @@ -874,7 +874,7 @@ public abstract class MediaplayerActivity extends CastEnabledActivity implements @Nullable private static FeedItem getFeedItem(@Nullable Playable playable) { - if (playable instanceof FeedMedia) { + if ((playable != null) && (playable instanceof FeedMedia)) { return ((FeedMedia)playable).getItem(); } else { return null;