Prevent crash

This commit is contained in:
M66B 2018-12-10 14:56:44 +01:00
parent 0f0a8817ee
commit 6dca04cd87
1 changed files with 6 additions and 2 deletions

View File

@ -421,8 +421,12 @@ public class FragmentMessages extends FragmentEx {
} else {
predicate.clearAccount();
fabMore.hide();
if (getViewLifecycleOwner().getLifecycle().getCurrentState().isAtLeast(Lifecycle.State.RESUMED))
loadMessages();
try {
if (getViewLifecycleOwner().getLifecycle().getCurrentState().isAtLeast(Lifecycle.State.RESUMED))
loadMessages();
} catch (IllegalStateException ex) {
Log.w(Helper.TAG, ex + "\n" + Log.getStackTraceString(ex));
}
swipeRefresh.setEnabled(true);
}
}