From f8316bde9191f8b2ef78eec24a1e5621e71c37a5 Mon Sep 17 00:00:00 2001 From: Fahim Salam Chowdhury Date: Mon, 9 May 2022 19:59:51 +0600 Subject: [PATCH] 293-Fix_null_pointer_exception_on_account_setup issue: https://gitlab.e.foundation/e/os/backlog/-/issues/293 --- .../fsck/k9/activity/setup/AccountSetupBasics.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/app/ui/legacy/src/main/java/com/fsck/k9/activity/setup/AccountSetupBasics.java b/app/ui/legacy/src/main/java/com/fsck/k9/activity/setup/AccountSetupBasics.java index 30d9521fd4..184e402bc9 100644 --- a/app/ui/legacy/src/main/java/com/fsck/k9/activity/setup/AccountSetupBasics.java +++ b/app/ui/legacy/src/main/java/com/fsck/k9/activity/setup/AccountSetupBasics.java @@ -307,9 +307,17 @@ public class AccountSetupBasics extends K9Activity onManualSetup(); return; } - String email = mEmailView.getText().toString(); + Editable emailEditable = mEmailView.getText(); + + if (emailEditable == null) { + return; + } + + String email = emailEditable.toString(); + + OAuth2Provider provider = OAuth2Provider.Companion.getProvider(email); - if(OAuth2Provider.Companion.getProvider(email).toString().trim().equals("GMAIL")){ + if(provider != null && provider.toString().trim().equals("GMAIL")){ Intent intent = new Intent(android.provider.Settings.ACTION_ADD_ACCOUNT); startActivity(intent); } -- GitLab