diff options
author | Alice Yang <alice@google.com> | 2013-03-04 14:10:21 -0800 |
---|---|---|
committer | Alice Yang <alice@google.com> | 2013-03-04 14:10:21 -0800 |
commit | c4d46df70d525cb2289bd76fb0b0b12637dbbe23 (patch) | |
tree | ab10e6a514bd493770ec15039e3880034a86f52c /chips | |
parent | 211ae63525c02ec914ef020af625ea4e7d8a3b29 (diff) | |
download | android_frameworks_ex-c4d46df70d525cb2289bd76fb0b0b12637dbbe23.tar.gz android_frameworks_ex-c4d46df70d525cb2289bd76fb0b0b12637dbbe23.tar.bz2 android_frameworks_ex-c4d46df70d525cb2289bd76fb0b0b12637dbbe23.zip |
Fix NPE.
Change-Id: Ibb2f12a2b7728fe0e6c5bc454bf9bce96f6e827c
Diffstat (limited to 'chips')
-rw-r--r-- | chips/src/com/android/ex/chips/RecipientEditTextView.java | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/chips/src/com/android/ex/chips/RecipientEditTextView.java b/chips/src/com/android/ex/chips/RecipientEditTextView.java index 14fe122..191b590 100644 --- a/chips/src/com/android/ex/chips/RecipientEditTextView.java +++ b/chips/src/com/android/ex/chips/RecipientEditTextView.java @@ -2243,6 +2243,7 @@ public class RecipientEditTextView extends MultiAutoCompleteTextView implements } } + @Override public <T extends ListAdapter & Filterable> void setAdapter(T adapter) { super.setAdapter(adapter); ((BaseRecipientAdapter) adapter) @@ -2484,8 +2485,8 @@ public class RecipientEditTextView extends MultiAutoCompleteTextView implements new ArrayList<RecipientChip>(); for (final RecipientChip temp : recipients) { RecipientEntry entry = null; - if (RecipientEntry.isCreatedRecipient(temp.getEntry() - .getContactId()) + if (temp != null && RecipientEntry.isCreatedRecipient( + temp.getEntry().getContactId()) && getSpannable().getSpanStart(temp) != -1) { // Replace this. entry = createValidatedEntry( |