From 324a1354a4fafa90eb7785a7410964787c771390 Mon Sep 17 00:00:00 2001 From: M66B Date: Fri, 8 Nov 2019 09:01:30 +0100 Subject: [PATCH] Prevent crash --- app/src/main/java/eu/faircode/email/FragmentCompose.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/eu/faircode/email/FragmentCompose.java b/app/src/main/java/eu/faircode/email/FragmentCompose.java index 686f9a9b06..cfe10d303c 100644 --- a/app/src/main/java/eu/faircode/email/FragmentCompose.java +++ b/app/src/main/java/eu/faircode/email/FragmentCompose.java @@ -1508,9 +1508,11 @@ public class FragmentCompose extends FragmentBase { protected void onExecuted(Bundle args, final Spanned body) { if (body == null) return; + int start = args.getInt("start"); etBody.setText(body); - etBody.setSelection(args.getInt("start")); + if (start < body.length()) + etBody.setSelection(start); // Save text & update remote draft onAction(R.id.action_save);