diff --git a/app/src/main/java/it/niedermann/owncloud/notes/exception/ExceptionDialogFragment.java b/app/src/main/java/it/niedermann/owncloud/notes/exception/ExceptionDialogFragment.java index b460e0cabe4b336a8c1d6e85c5382308d24e3e30..adcde8705fc0583a531ce4da47490531aa9d49b4 100644 --- a/app/src/main/java/it/niedermann/owncloud/notes/exception/ExceptionDialogFragment.java +++ b/app/src/main/java/it/niedermann/owncloud/notes/exception/ExceptionDialogFragment.java @@ -101,12 +101,16 @@ public class ExceptionDialogFragment extends AppCompatDialogFragment { @Override public void show(@NonNull FragmentManager manager, @Nullable String tag) { - if (manager.isDestroyed() || !manager.isStateSaved()) { + try { + if (manager.isDestroyed() || !manager.isStateSaved()) { + Log.e("ExceptionDialog can't be shown as the state is lost. The cause:\n\n" + getStackStrace()); + return; + } + + super.show(manager, tag); + } catch (IllegalStateException e) { Log.e("ExceptionDialog can't be shown as the state is lost. The cause:\n\n" + getStackStrace()); - return; } - - super.show(manager, tag); } @NonNull