mirror of
https://github.com/M66B/FairEmail.git
synced 2026-04-12 03:54:28 +02:00
Prevent crash
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user