mirror of
https://github.com/M66B/FairEmail.git
synced 2026-04-09 10:33:41 +02:00
Added fail safe
This commit is contained in:
@@ -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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user