From c2001e2d7215e5a1df7323b45254ad5bc94e7bbe Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Mon, 13 Dec 2021 15:58:59 +0100 Subject: [PATCH] Fix a crash on Epoxy if text contains '\u200D' --- .../home/room/detail/timeline/tools/EventRenderingTools.kt | 4 ++++ 1 file changed, 4 insertions(+) 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 1e8a81ff61b..d3e211a18a7 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 @@ -43,6 +43,10 @@ fun CharSequence.findPillsAndProcess(scope: CoroutineScope, processBlock: (PillI } fun CharSequence.linkify(callback: TimelineEventController.UrlClickCallback?): CharSequence { + // Do not do anything for texts which contain the Unicode Character 'ZERO WIDTH JOINER' (U+200D) in Emojis + if (contains('\u200D')) { + return this + } val text = this.toString() val spannable = toSpannable() MatrixLinkify.addLinks(spannable, object : MatrixPermalinkSpan.Callback {