From ffccac682e771c4ff0553e5b403207a41eb232cb Mon Sep 17 00:00:00 2001 From: Laky64 <35636667+Laky-64@users.noreply.github.com> Date: Thu, 29 Dec 2022 14:09:04 +0100 Subject: [PATCH] Update EditTextEffects.java --- .../main/java/org/telegram/ui/Components/EditTextEffects.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Components/EditTextEffects.java b/TMessagesProj/src/main/java/org/telegram/ui/Components/EditTextEffects.java index fd9bab36d..587678298 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Components/EditTextEffects.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Components/EditTextEffects.java @@ -146,8 +146,7 @@ public class EditTextEffects extends EditText { invalidateEffects(); Layout layout = getLayout(); - if (text instanceof Spannable && layout != null) { - if (start > layout.getLineCount()) return; + if (text instanceof Spannable && layout != null && start <= layout.getLineCount()) { int line = layout.getLineForOffset(start); int x = (int) layout.getPrimaryHorizontal(start); int y = (int) ((layout.getLineTop(line) + layout.getLineBottom(line)) / 2f);