From 2deb39b19a8de218343a35fc40f99080fb047b8e Mon Sep 17 00:00:00 2001 From: M66B Date: Mon, 30 May 2022 18:15:56 +0200 Subject: [PATCH] Prevent crash --- .../main/java/eu/faircode/email/FragmentDialogTranslate.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/src/main/java/eu/faircode/email/FragmentDialogTranslate.java b/app/src/main/java/eu/faircode/email/FragmentDialogTranslate.java index 879981192c..9ec79fcb82 100644 --- a/app/src/main/java/eu/faircode/email/FragmentDialogTranslate.java +++ b/app/src/main/java/eu/faircode/email/FragmentDialogTranslate.java @@ -227,6 +227,8 @@ public class FragmentDialogTranslate extends FragmentDialogBase { private void translate(TextView widget, Spannable buffer, MotionEvent event) { int off = Helper.getOffset(widget, buffer, event); + if (off < 0) + return; int start = off; while (start > 0 && buffer.charAt(start - 1) != '\n')