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:
parent
ed53a97323
commit
39c1964d50
1 changed files with 9 additions and 2 deletions
|
@ -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();
|
||||
|
||||
|
|
Loading…
Reference in a new issue