From c376c84df947e6e20385f2ef56129f6f74c8e8d5 Mon Sep 17 00:00:00 2001 From: Jonas Heubuch Date: Tue, 6 Aug 2024 09:07:52 +0200 Subject: [PATCH] :bug: Fix crash when mentioned user does not exist --- .../main/kotlin/de/hbch/traewelling/api/models/status/Status.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/kotlin/de/hbch/traewelling/api/models/status/Status.kt b/app/src/main/kotlin/de/hbch/traewelling/api/models/status/Status.kt index 22f8468d..4edf56dd 100644 --- a/app/src/main/kotlin/de/hbch/traewelling/api/models/status/Status.kt +++ b/app/src/main/kotlin/de/hbch/traewelling/api/models/status/Status.kt @@ -78,8 +78,8 @@ data class Status( if (usernames.contains(match)) { val username = match.groupValues.getOrElse(1) { "" } + builder.append(statusBody.substring(match.range)) if (mentions.any { it.user.username == username }) { - builder.append(statusBody.substring(match.range)) builder.addStyle(usernameStyle, match.range.first, match.range.last + 1) builder.addStringAnnotation( "userMention",