1
0
Fork 0
mirror of https://github.com/M66B/FairEmail.git synced 2025-01-02 13:14:39 +00:00

Added fail safe

This commit is contained in:
M66B 2021-05-30 17:54:27 +02:00
parent ed53a97323
commit 39c1964d50

View file

@ -5782,8 +5782,15 @@ public class FragmentCompose extends FragmentBase {
@Override
public void run() {
try {
if (target instanceof EditText && s >= 0)
((EditText) target).setSelection(s, e < 0 ? s : e);
if (target instanceof EditText) {
EditText et = (EditText) target;
int len = et.length();
if (s >= 0 && s <= len && e <= len)
if (e < 0)
et.setSelection(s);
else
et.setSelection(s, e);
}
target.requestFocus();