Fixed NPE when selected item is null

The method is called again with a valid listAdapter automatically
Closes #3154
This commit is contained in:
ByteHamster 2019-05-03 11:56:24 +02:00
parent 7a921e0024
commit 7f514384fc

View File

@ -279,11 +279,11 @@ public class AllEpisodesFragment extends Fragment {
return true; // avoids that the position is reset when we need it in the submenu
}
FeedItem selectedItem = listAdapter.getSelectedItem();
if (selectedItem == null) {
Log.i(TAG, "Selected item was null, ignoring selection");
if (listAdapter == null || listAdapter.getSelectedItem() == null) {
Log.i(TAG, "Selected item or listAdapter was null, ignoring selection");
return super.onContextItemSelected(item);
}
FeedItem selectedItem = listAdapter.getSelectedItem();
// Mark as seen contains UI logic specific to All/New/FavoriteSegments,
// e.g., Undo with Snackbar,