summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYvonne Wong <ywong@cyngn.com>2015-08-03 15:47:37 -0700
committerSteve Kondik <steve@cyngn.com>2015-10-18 14:23:08 -0700
commit602ba5f29f3688fc0dafae1d737d4beff4a78ffc (patch)
treed4d14dd2996144aacb3c4ed2f1bf31b29eb2b525
parent768a467547ac44acd4a049f3ffe07e549efaf442 (diff)
downloadandroid_frameworks_opt_chips-602ba5f29f3688fc0dafae1d737d4beff4a78ffc.tar.gz
android_frameworks_opt_chips-602ba5f29f3688fc0dafae1d737d4beff4a78ffc.tar.bz2
android_frameworks_opt_chips-602ba5f29f3688fc0dafae1d737d4beff4a78ffc.zip
Fix exception that crashes app when <<>> chip is clicked on
issue-id: CYNGNOS-522 Change-Id: Ia4500371af22365f1f8a9d9aa50dd43216826b26
-rw-r--r--src/com/android/ex/chips/DropdownChipLayouter.java8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/com/android/ex/chips/DropdownChipLayouter.java b/src/com/android/ex/chips/DropdownChipLayouter.java
index 7e62db8..ed2801e 100644
--- a/src/com/android/ex/chips/DropdownChipLayouter.java
+++ b/src/com/android/ex/chips/DropdownChipLayouter.java
@@ -19,6 +19,7 @@ import android.text.SpannableStringBuilder;
import android.text.Spanned;
import android.text.TextUtils;
import android.text.style.ForegroundColorSpan;
+import android.text.util.Rfc822Token;
import android.text.util.Rfc822Tokenizer;
import android.view.LayoutInflater;
import android.view.View;
@@ -292,7 +293,12 @@ public class DropdownChipLayouter {
}
break;
case SINGLE_RECIPIENT:
- destination = Rfc822Tokenizer.tokenize(entry.getDestination())[0].getAddress();
+ Rfc822Token[] tokens = Rfc822Tokenizer.tokenize(entry.getDestination());
+
+ if (tokens.length > 0) {
+ destination = tokens[0].getAddress();
+ }
+
destinationType = null;
}