summaryrefslogtreecommitdiffstats
path: root/chips/src/com/android/ex/chips/RecipientEditTextView.java
diff options
context:
space:
mode:
Diffstat (limited to 'chips/src/com/android/ex/chips/RecipientEditTextView.java')
-rw-r--r--chips/src/com/android/ex/chips/RecipientEditTextView.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/chips/src/com/android/ex/chips/RecipientEditTextView.java b/chips/src/com/android/ex/chips/RecipientEditTextView.java
index 8b6367f..62a60b0 100644
--- a/chips/src/com/android/ex/chips/RecipientEditTextView.java
+++ b/chips/src/com/android/ex/chips/RecipientEditTextView.java
@@ -2566,7 +2566,8 @@ public class RecipientEditTextView extends MultiAutoCompleteTextView implements
if (start != -1) {
// Replacing the entirety of what the chip represented,
// including the extra space dividing it from other chips.
- final int end = text.getSpanEnd(chip) + 1;
+ final int end =
+ Math.min(text.getSpanEnd(chip) + 1, text.length());
text.removeSpan(chip);
// Make sure we always have just 1 space at the end to
// separate this chip from the next chip.