summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Westbrook <pwestbro@google.com>2013-04-30 14:04:09 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2013-04-30 14:04:09 -0700
commit784638ebd2f86bd7f7cd27a5519fc3fdba81a2a8 (patch)
treeecc9d0769e9d71c82d2943ff078ba7c061940106
parent6838f55343073a3697928ce8d91342f75d705352 (diff)
parentd259fd2d897c741fa5ca1067a4596beeb2e0a938 (diff)
downloadandroid_frameworks_ex-784638ebd2f86bd7f7cd27a5519fc3fdba81a2a8.tar.gz
android_frameworks_ex-784638ebd2f86bd7f7cd27a5519fc3fdba81a2a8.tar.bz2
android_frameworks_ex-784638ebd2f86bd7f7cd27a5519fc3fdba81a2a8.zip
am d259fd2d: Prevent IOOB exception
* commit 'd259fd2d897c741fa5ca1067a4596beeb2e0a938': Prevent IOOB exception
-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.