From 555ea550cdb698b08def90613a0552aae038acb7 Mon Sep 17 00:00:00 2001 From: M66B Date: Sun, 20 Sep 2020 17:00:09 +0200 Subject: [PATCH] Check for browser --- app/src/main/java/eu/faircode/email/FragmentOAuth.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/eu/faircode/email/FragmentOAuth.java b/app/src/main/java/eu/faircode/email/FragmentOAuth.java index a6da3d85e8..f991a8e13a 100644 --- a/app/src/main/java/eu/faircode/email/FragmentOAuth.java +++ b/app/src/main/java/eu/faircode/email/FragmentOAuth.java @@ -295,7 +295,12 @@ public class FragmentOAuth extends FragmentBase { AuthorizationRequest authRequest = authRequestBuilder.build(); Log.i("OAuth request provider=" + provider.id + " uri=" + authRequest.toUri()); - Intent authIntent = authService.getAuthorizationRequestIntent(authRequest); + Intent authIntent = null; + try { + authIntent = authService.getAuthorizationRequestIntent(authRequest); + } catch (ActivityNotFoundException ex) { + throw new ActivityNotFoundException("Browser not found"); + } PackageManager pm = getContext().getPackageManager(); if (authIntent.resolveActivity(pm) == null) // action whitelisted throw new ActivityNotFoundException(authIntent.toString());