Prevent crash

This commit is contained in:
M66B 2022-02-23 17:07:24 +01:00
parent 6d0dc5095a
commit 10f8a98043
1 changed files with 10 additions and 1 deletions

View File

@ -164,7 +164,16 @@ public class EditTextMultiAutoComplete extends AppCompatMultiAutoCompleteTextVie
int off = Helper.getOffset(this, edit, event);
ClipImageSpan[] spans = edit.getSpans(off, off, ClipImageSpan.class);
if (spans.length == 1)
edit.removeSpan(spans[0]);
post(new Runnable() {
@Override
public void run() {
try {
edit.removeSpan(spans[0]);
} catch (Throwable ex) {
Log.e(ex);
}
}
});
}
} catch (Throwable ex) {
Log.w(ex);