From b2bedf905e2c4c61bdaabeb9974ab169970a873a Mon Sep 17 00:00:00 2001 From: Tangem Date: Mon, 20 Oct 2025 13:23:37 +0300 Subject: [PATCH] Updated on 2026-08-14 --- .../com/tangem/core/ui/components/atoms/text/BoundCounter.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/ui/src/main/java/com/tangem/core/ui/components/atoms/text/BoundCounter.kt b/core/ui/src/main/java/com/tangem/core/ui/components/atoms/text/BoundCounter.kt index 6a97038b3d..7bda686f02 100644 --- a/core/ui/src/main/java/com/tangem/core/ui/components/atoms/text/BoundCounter.kt +++ b/core/ui/src/main/java/com/tangem/core/ui/components/atoms/text/BoundCounter.kt @@ -31,7 +31,9 @@ internal class BoundCounter( } fun addNextChar() { - string += text[charPosition(string.count())] + val nextIndex = charPosition(string.count()) + if (nextIndex < 0 || nextIndex >= text.length) return + string += text[nextIndex] width += nextCharWidth() _nextCharWidth = null }