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 30d9521fd4bfafb114a3bee0d48c07aab8df0f9c..184e402bc98b0abf04325ee21a0d3605dab96cb7 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); }