mirror of
https://github.com/M66B/FairEmail.git
synced 2025-02-22 14:11:00 +00:00
Prevent crash
This commit is contained in:
parent
d034dc93e8
commit
7e7ccfa9b5
1 changed files with 13 additions and 12 deletions
|
@ -429,21 +429,22 @@ public class FragmentMessages extends FragmentEx {
|
||||||
selectionTracker.addObserver(new SelectionTracker.SelectionObserver() {
|
selectionTracker.addObserver(new SelectionTracker.SelectionObserver() {
|
||||||
@Override
|
@Override
|
||||||
public void onSelectionChanged() {
|
public void onSelectionChanged() {
|
||||||
if (selectionTracker.hasSelection()) {
|
try {
|
||||||
swipeRefresh.setEnabled(false);
|
if (selectionTracker.hasSelection()) {
|
||||||
if (messages != null)
|
swipeRefresh.setEnabled(false);
|
||||||
messages.removeObservers(getViewLifecycleOwner());
|
if (getViewLifecycleOwner().getLifecycle().getCurrentState().isAtLeast(Lifecycle.State.RESUMED))
|
||||||
fabMore.show();
|
if (messages != null)
|
||||||
} else {
|
messages.removeObservers(getViewLifecycleOwner());
|
||||||
predicate.clearAccount();
|
fabMore.show();
|
||||||
fabMore.hide();
|
} else {
|
||||||
try {
|
predicate.clearAccount();
|
||||||
|
fabMore.hide();
|
||||||
if (getViewLifecycleOwner().getLifecycle().getCurrentState().isAtLeast(Lifecycle.State.RESUMED))
|
if (getViewLifecycleOwner().getLifecycle().getCurrentState().isAtLeast(Lifecycle.State.RESUMED))
|
||||||
loadMessages();
|
loadMessages();
|
||||||
} catch (IllegalStateException ex) {
|
swipeRefresh.setEnabled(true);
|
||||||
Log.w(ex);
|
|
||||||
}
|
}
|
||||||
swipeRefresh.setEnabled(true);
|
} catch (IllegalStateException ex) {
|
||||||
|
Log.w(ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue