Fix crash caused by empty span when removing leading newlines

Change-Id: I9045bf1314b15d3672d1837bca29fa4af4c0fdbd
This commit is contained in:
SpiritCroc 2023-04-05 10:24:41 +02:00
parent 16afd70294
commit 1e3b77824e
1 changed files with 3 additions and 0 deletions

View File

@ -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, "")
}