From 2275bdd4fa5a4a389ddd4a09b8a2dba943a2bc4f Mon Sep 17 00:00:00 2001 From: ariskotsomitopoulos Date: Thu, 16 Dec 2021 20:14:21 +0200 Subject: [PATCH] Fix crash ImmutableModelException --- .../home/room/detail/timeline/tools/EventRenderingTools.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/tools/EventRenderingTools.kt b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/tools/EventRenderingTools.kt index 1e8a81ff61..4abaa4fae4 100644 --- a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/tools/EventRenderingTools.kt +++ b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/tools/EventRenderingTools.kt @@ -16,6 +16,7 @@ package im.vector.app.features.home.room.detail.timeline.tools +import android.text.SpannableStringBuilder import android.text.style.ClickableSpan import android.view.MotionEvent import android.widget.TextView @@ -44,7 +45,7 @@ fun CharSequence.findPillsAndProcess(scope: CoroutineScope, processBlock: (PillI fun CharSequence.linkify(callback: TimelineEventController.UrlClickCallback?): CharSequence { val text = this.toString() - val spannable = toSpannable() + val spannable = SpannableStringBuilder(this) MatrixLinkify.addLinks(spannable, object : MatrixPermalinkSpan.Callback { override fun onUrlClicked(url: String) { callback?.onUrlClicked(url, text)