mirror of
https://github.com/M66B/FairEmail.git
synced 2025-01-01 12:44:42 +00:00
Prevent crash
This commit is contained in:
parent
10aa8075ea
commit
bffe51d71c
1 changed files with 6 additions and 0 deletions
|
@ -1415,6 +1415,9 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
|
|||
selectionTracker.addObserver(new SelectionTracker.SelectionObserver<Long>() {
|
||||
@Override
|
||||
public void onSelectionChanged() {
|
||||
if (!getViewLifecycleOwner().getLifecycle().getCurrentState().isAtLeast(Lifecycle.State.STARTED))
|
||||
return;
|
||||
|
||||
FragmentActivity activity = getActivity();
|
||||
if (activity != null)
|
||||
activity.invalidateOptionsMenu();
|
||||
|
@ -1424,6 +1427,9 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
|
|||
|
||||
@Override
|
||||
public void onItemStateChanged(@NonNull Long key, boolean selected) {
|
||||
if (!getViewLifecycleOwner().getLifecycle().getCurrentState().isAtLeast(Lifecycle.State.STARTED))
|
||||
return;
|
||||
|
||||
int pos = adapter.getPositionForKey(key);
|
||||
if (pos == NO_POSITION)
|
||||
return;
|
||||
|
|
Loading…
Reference in a new issue