commit | 11a2adb53f764ffcadd262678ff782e6b4992dec | [log] [tgz] |
---|---|---|
author | Mindy Pereira <mindyp@google.com> | Tue Jun 28 09:57:43 2011 -0700 |
committer | Mindy Pereira <mindyp@google.com> | Tue Jun 28 09:57:43 2011 -0700 |
tree | 2a085f61b4e28e9f859ac0fac896aeba3e551698 | |
parent | 749acf9bcf637bfe193b10f917888cb463dda9a5 [diff] |
If the selection happens to be at zero, dont look for the char before. Fixes Bug:4969660 java.lang.IndexOutOfBoundsException: charAt: -1 < 0 Change-Id: Ie307b3088be32e2cf9afdfdcf1c0106046dbc805
diff --git a/src/com/android/ex/chips/RecipientEditTextView.java b/src/com/android/ex/chips/RecipientEditTextView.java index 02fd9d5..a2c9191 100644 --- a/src/com/android/ex/chips/RecipientEditTextView.java +++ b/src/com/android/ex/chips/RecipientEditTextView.java
@@ -1243,7 +1243,7 @@ // not just the commit character. if (length > 1) { char last; - int end = getSelectionEnd() - 1; + int end = getSelectionEnd() == 0 ? 0 : getSelectionEnd() - 1; int len = length() - 1; if (end != len) { last = s.charAt(end);