From 10f8a980439033b225653acfcc521f3448070f2e Mon Sep 17 00:00:00 2001 From: M66B Date: Wed, 23 Feb 2022 17:07:24 +0100 Subject: [PATCH] Prevent crash --- .../eu/faircode/email/EditTextMultiAutoComplete.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/eu/faircode/email/EditTextMultiAutoComplete.java b/app/src/main/java/eu/faircode/email/EditTextMultiAutoComplete.java index 967bc123f4..68dabed73a 100644 --- a/app/src/main/java/eu/faircode/email/EditTextMultiAutoComplete.java +++ b/app/src/main/java/eu/faircode/email/EditTextMultiAutoComplete.java @@ -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);