From 94e155e6526c4c4d7e5ca4e8f2d591c5ca804581 Mon Sep 17 00:00:00 2001 From: M66B Date: Mon, 6 Apr 2020 20:59:32 +0200 Subject: [PATCH] Fail-safe --- .../java/eu/faircode/email/FragmentOAuth.java | 24 +++++++++++-------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/FragmentOAuth.java b/app/src/main/java/eu/faircode/email/FragmentOAuth.java index 74322ae06c..76517ab24b 100644 --- a/app/src/main/java/eu/faircode/email/FragmentOAuth.java +++ b/app/src/main/java/eu/faircode/email/FragmentOAuth.java @@ -192,16 +192,20 @@ public class FragmentOAuth extends FragmentBase { public void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); - switch (requestCode) { - case ActivitySetup.REQUEST_OAUTH: - if (resultCode == RESULT_OK && data != null) - onHandleOAuth(data); - else - onHandleCancel(); - break; - case ActivitySetup.REQUEST_DONE: - finish(); - break; + try { + switch (requestCode) { + case ActivitySetup.REQUEST_OAUTH: + if (resultCode == RESULT_OK && data != null) + onHandleOAuth(data); + else + onHandleCancel(); + break; + case ActivitySetup.REQUEST_DONE: + finish(); + break; + } + } catch (Throwable ex) { + Log.e(ex); } }