From b4defa1716129f45760b07f204330f0a74a9e4e3 Mon Sep 17 00:00:00 2001 From: Yuku on yuku9 Date: Sat, 18 Jul 2020 21:11:09 +0800 Subject: [PATCH] Catch errors in dismissing dialog --- .gitignore | 1 + .../main/java/yuku/alkitab/base/util/ShareUrl.java | 12 ++++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 9417f6f36..5b1d97328 100644 --- a/.gitignore +++ b/.gitignore @@ -8,6 +8,7 @@ /.idea/caches /.idea/assetWizardSettings.xml /.idea/modules.xml +/.idea/jarRepositories.xml /build local.properties diff --git a/Alkitab/src/main/java/yuku/alkitab/base/util/ShareUrl.java b/Alkitab/src/main/java/yuku/alkitab/base/util/ShareUrl.java index afd285ced..c3a3e655d 100644 --- a/Alkitab/src/main/java/yuku/alkitab/base/util/ShareUrl.java +++ b/Alkitab/src/main/java/yuku/alkitab/base/util/ShareUrl.java @@ -84,14 +84,22 @@ public static void make(@NonNull final Activity activity, final boolean immediat done.set(true); callback.onUserCancel(); - dialog1.dismiss(); + try { + dialog1.dismiss(); + } catch (Exception ignored) { + } + callback.onFinally(); }) .dismissListener(dialog1 -> { if (done.getAndSet(true)) return; callback.onUserCancel(); - dialog1.dismiss(); + try { + dialog1.dismiss(); + } catch (Exception ignored) { + } + callback.onFinally(); }) .show();