diff --git a/vector/src/main/java/im/vector/app/features/html/EventHtmlRenderer.kt b/vector/src/main/java/im/vector/app/features/html/EventHtmlRenderer.kt index 4bfed12f3a..49acd4dbaa 100644 --- a/vector/src/main/java/im/vector/app/features/html/EventHtmlRenderer.kt +++ b/vector/src/main/java/im/vector/app/features/html/EventHtmlRenderer.kt @@ -277,6 +277,9 @@ class EventHtmlRenderer @Inject constructor( spans.forEach { span -> val start = text.getSpanStart(span) + if (start < 0) { + return@forEach + } if (text[start] == '\n') { text.replace(start, start + 1, "") }