Browse Source

Merge pull request #1984 from nextcloud/dismissDialog

Try to avoid Exception on dismissDialog
Andy Scherzinger 7 years ago
parent
commit
d7dd8c120d

+ 7 - 1
src/main/java/com/owncloud/android/authentication/AuthenticatorActivity.java

@@ -2222,7 +2222,13 @@ public class AuthenticatorActivity extends AccountAuthenticatorActivity
         Fragment frag = getSupportFragmentManager().findFragmentByTag(dialogTag);
         if (frag instanceof DialogFragment) {
             DialogFragment dialog = (DialogFragment) frag;
-            dialog.dismiss();
+
+            try {
+                dialog.dismiss();
+            } catch (IllegalStateException e) {
+                Log_OC.e(TAG, e.getMessage());
+                dialog.dismissAllowingStateLoss();
+            }
         }
     }