Merge pull request #3156 from ByteHamster/crash-episodes-long-press

Fixed NPE when selected item is null
This commit is contained in:
H. Lehmann 2019-05-03 12:23:08 +02:00 committed by GitHub
commit 605475d2ed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

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 return true; // avoids that the position is reset when we need it in the submenu
} }
FeedItem selectedItem = listAdapter.getSelectedItem(); if (listAdapter == null || listAdapter.getSelectedItem() == null) {
if (selectedItem == null) { Log.i(TAG, "Selected item or listAdapter was null, ignoring selection");
Log.i(TAG, "Selected item was null, ignoring selection");
return super.onContextItemSelected(item); return super.onContextItemSelected(item);
} }
FeedItem selectedItem = listAdapter.getSelectedItem();
// Mark as seen contains UI logic specific to All/New/FavoriteSegments, // Mark as seen contains UI logic specific to All/New/FavoriteSegments,
// e.g., Undo with Snackbar, // e.g., Undo with Snackbar,