#2929 - review feedback: non-null feedItem requirement explicit

This commit is contained in:
orionlee 2019-09-22 13:28:25 -07:00
parent 427477b256
commit 9c8eda170d
1 changed files with 5 additions and 5 deletions

View File

@ -391,7 +391,7 @@ public abstract class MediaplayerActivity extends CastEnabledActivity implements
return true; return true;
} else { } else {
if (media != null) { if (media != null) {
final FeedItem feedItem = getFeedItem(media); // some options option requires FeedItem final @Nullable FeedItem feedItem = getFeedItem(media); // some options option requires FeedItem
switch (item.getItemId()) { switch (item.getItemId()) {
case R.id.add_to_favorites_item: case R.id.add_to_favorites_item:
if (feedItem != null) { if (feedItem != null) {
@ -456,22 +456,22 @@ public abstract class MediaplayerActivity extends CastEnabledActivity implements
startActivity(new Intent(Intent.ACTION_VIEW, uri)); startActivity(new Intent(Intent.ACTION_VIEW, uri));
break; break;
case R.id.share_link_item: case R.id.share_link_item:
if (media instanceof FeedMedia) { if (feedItem != null) {
ShareUtils.shareFeedItemLink(this, feedItem); ShareUtils.shareFeedItemLink(this, feedItem);
} }
break; break;
case R.id.share_download_url_item: case R.id.share_download_url_item:
if (media instanceof FeedMedia) { if (feedItem != null) {
ShareUtils.shareFeedItemDownloadLink(this, feedItem); ShareUtils.shareFeedItemDownloadLink(this, feedItem);
} }
break; break;
case R.id.share_link_with_position_item: case R.id.share_link_with_position_item:
if (media instanceof FeedMedia) { if (feedItem != null) {
ShareUtils.shareFeedItemLink(this, feedItem, true); ShareUtils.shareFeedItemLink(this, feedItem, true);
} }
break; break;
case R.id.share_download_url_with_position_item: case R.id.share_download_url_with_position_item:
if (media instanceof FeedMedia) { if (feedItem != null) {
ShareUtils.shareFeedItemDownloadLink(this, feedItem, true); ShareUtils.shareFeedItemDownloadLink(this, feedItem, true);
} }
break; break;