Fix NPE.
Change-Id: Ibb2f12a2b7728fe0e6c5bc454bf9bce96f6e827c
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 @@
}
}
+ @Override
public <T extends ListAdapter & Filterable> void setAdapter(T adapter) {
super.setAdapter(adapter);
((BaseRecipientAdapter) adapter)
@@ -2484,8 +2485,8 @@
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(