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
2ec84d6c5a
commit
7d53bf3d80
1 changed files with 6 additions and 5 deletions
|
@ -1415,7 +1415,7 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
|
||||||
selectionTracker.addObserver(new SelectionTracker.SelectionObserver<Long>() {
|
selectionTracker.addObserver(new SelectionTracker.SelectionObserver<Long>() {
|
||||||
@Override
|
@Override
|
||||||
public void onSelectionChanged() {
|
public void onSelectionChanged() {
|
||||||
if (!getViewLifecycleOwner().getLifecycle().getCurrentState().isAtLeast(Lifecycle.State.STARTED))
|
if (!getLifecycle().getCurrentState().isAtLeast(Lifecycle.State.STARTED))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
FragmentActivity activity = getActivity();
|
FragmentActivity activity = getActivity();
|
||||||
|
@ -1427,7 +1427,7 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onItemStateChanged(@NonNull Long key, boolean selected) {
|
public void onItemStateChanged(@NonNull Long key, boolean selected) {
|
||||||
if (!getViewLifecycleOwner().getLifecycle().getCurrentState().isAtLeast(Lifecycle.State.STARTED))
|
if (!getLifecycle().getCurrentState().isAtLeast(Lifecycle.State.STARTED))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
int pos = adapter.getPositionForKey(key);
|
int pos = adapter.getPositionForKey(key);
|
||||||
|
@ -1473,6 +1473,9 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isInAbsoluteEnd() {
|
public boolean isInAbsoluteEnd() {
|
||||||
|
if (!getLifecycle().getCurrentState().isAtLeast(Lifecycle.State.STARTED))
|
||||||
|
return false;
|
||||||
|
|
||||||
PagedList<TupleMessageEx> list = ((AdapterMessage) rvMessage.getAdapter()).getCurrentList();
|
PagedList<TupleMessageEx> list = ((AdapterMessage) rvMessage.getAdapter()).getCurrentList();
|
||||||
if (list == null)
|
if (list == null)
|
||||||
return false;
|
return false;
|
||||||
|
@ -5271,9 +5274,7 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
|
||||||
Context context = getContext();
|
Context context = getContext();
|
||||||
if (context == null)
|
if (context == null)
|
||||||
return;
|
return;
|
||||||
if (getView() == null)
|
if (!getLifecycle().getCurrentState().isAtLeast(Lifecycle.State.STARTED))
|
||||||
return;
|
|
||||||
if (!getViewLifecycleOwner().getLifecycle().getCurrentState().isAtLeast(Lifecycle.State.STARTED))
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
|
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
|
||||||
|
|
Loading…
Reference in a new issue