Prevent crash

This commit is contained in:
M66B 2022-05-30 18:15:56 +02:00
parent 5bca6849c5
commit 2deb39b19a
1 changed files with 2 additions and 0 deletions

View File

@ -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')