Make sure template insert position is valid

This commit is contained in:
M66B 2020-09-14 16:48:30 +02:00
parent 01fe2161ee
commit 34dd2073ef
1 changed files with 5 additions and 1 deletions

View File

@ -1630,7 +1630,11 @@ public class FragmentCompose extends FragmentBase {
}
}, null, getContext());
etBody.getText().insert(etBody.getSelectionStart(), spanned);
int start = etBody.getSelectionStart();
if (start < 0)
start = 0;
etBody.getText().insert(start, spanned);
return true;
}