mirror of
https://github.com/DrKLO/Telegram.git
synced 2025-01-03 17:52:22 +01:00
Fix issue with search in ActionBar
This pull request fixes an issue where searching for the "from:" keyword in the ActionBar would cause the app to crash. The issue was caused by attempting to access a line in the layout that did not exist. The solution is to add a check to ensure that the line offset is within the bounds of the layout before attempting to access it. This fix will prevent the app from crashing when searching for "from:" in the ActionBar.
This commit is contained in:
parent
2c71f6c92b
commit
711f26cb11
1 changed files with 1 additions and 0 deletions
|
@ -147,6 +147,7 @@ public class EditTextEffects extends EditText {
|
|||
|
||||
Layout layout = getLayout();
|
||||
if (text instanceof Spannable && layout != null) {
|
||||
if (start > layout.getLineCount()) return;
|
||||
int line = layout.getLineForOffset(start);
|
||||
int x = (int) layout.getPrimaryHorizontal(start);
|
||||
int y = (int) ((layout.getLineTop(line) + layout.getLineBottom(line)) / 2f);
|
||||
|
|
Loading…
Reference in a new issue