From c651487f01261ad0499e1afe7ec9319fbc54bb4e Mon Sep 17 00:00:00 2001 From: Stephen Paul Weber Date: Tue, 23 Jul 2024 08:33:29 -0500 Subject: [PATCH] out of bounds guard --- .../java/eu/siacs/conversations/ui/adapter/MessageAdapter.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/java/eu/siacs/conversations/ui/adapter/MessageAdapter.java b/src/main/java/eu/siacs/conversations/ui/adapter/MessageAdapter.java index 4ba15d994..0c33e500a 100644 --- a/src/main/java/eu/siacs/conversations/ui/adapter/MessageAdapter.java +++ b/src/main/java/eu/siacs/conversations/ui/adapter/MessageAdapter.java @@ -641,6 +641,8 @@ public class MessageAdapter extends ArrayAdapter { for (final android.text.style.QuoteSpan quote : body.getSpans(0, body.length(), android.text.style.QuoteSpan.class)) { int start = body.getSpanStart(quote); int end = body.getSpanEnd(quote); + if (start < 0 || end < 0) continue; + body.removeSpan(quote); applyQuoteSpan(viewHolder.messageBody, body, start, end, bubbleColor, true); if (start == 0) { -- 2.45.2