From dbe483b70280dde754d79c527fd732fb992f87b8 Mon Sep 17 00:00:00 2001 From: M66B Date: Mon, 25 Nov 2019 09:04:02 +0100 Subject: [PATCH] Allow missing identity --- app/src/main/java/eu/faircode/email/FragmentCompose.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/FragmentCompose.java b/app/src/main/java/eu/faircode/email/FragmentCompose.java index 2560cb7fff..90422d0d3f 100644 --- a/app/src/main/java/eu/faircode/email/FragmentCompose.java +++ b/app/src/main/java/eu/faircode/email/FragmentCompose.java @@ -1877,8 +1877,6 @@ public class FragmentCompose extends FragmentBase { private void onAction(int action, @NonNull Bundle extras) { EntityIdentity identity = (EntityIdentity) spIdentity.getSelectedItem(); - if (identity == null) - throw new IllegalArgumentException(getString(R.string.title_from_missing)); // Workaround underlines left by Android etBody.clearComposingText(); @@ -1886,8 +1884,8 @@ public class FragmentCompose extends FragmentBase { Bundle args = new Bundle(); args.putLong("id", working); args.putInt("action", action); - args.putLong("account", identity.account); - args.putLong("identity", identity.id); + args.putLong("account", identity == null ? -1 : identity.account); + args.putLong("identity", identity == null ? -1 : identity.id); args.putString("extra", etExtra.getText().toString().trim()); args.putString("to", etTo.getText().toString().trim()); args.putString("cc", etCc.getText().toString().trim());