aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinnea Gräf <nea@nea.moe>2025-06-29 13:19:16 +0200
committerLinnea Gräf <nea@nea.moe>2025-06-29 13:21:25 +0200
commitf8cbaae1cad05c2a5e28680436e8a1b74da9dd6c (patch)
tree3fb078e3d0ed968e0717ec23c755fac61073876d
parent0af329c17ac02b69a3b52135726f496597c23f08 (diff)
downloadFirmament-f8cbaae1cad05c2a5e28680436e8a1b74da9dd6c.tar.gz
Firmament-f8cbaae1cad05c2a5e28680436e8a1b74da9dd6c.tar.bz2
Firmament-f8cbaae1cad05c2a5e28680436e8a1b74da9dd6c.zip
fix: wrong null check in chat links
-rw-r--r--src/main/kotlin/features/chat/ChatLinks.kt2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/main/kotlin/features/chat/ChatLinks.kt b/src/main/kotlin/features/chat/ChatLinks.kt
index 869fe62..1fb12e1 100644
--- a/src/main/kotlin/features/chat/ChatLinks.kt
+++ b/src/main/kotlin/features/chat/ChatLinks.kt
@@ -141,7 +141,7 @@ object ChatLinks : FirmamentFeature {
val nextMatch = urlRegex.find(text, index)
val url = nextMatch?.groupValues[0]
val uri = runCatching { url?.let(::URI) }.getOrNull()
- if (nextMatch == null || url == null) {
+ if (nextMatch == null || url == null || uri == null) {
s.append(Text.literal(text.substring(index, text.length)))
break
}