diff --git a/library/src/main/java/com/pchmn/materialchips/adapter/FilterableAdapter.java b/library/src/main/java/com/pchmn/materialchips/adapter/FilterableAdapter.java index 68b91519..90d536c6 100644 --- a/library/src/main/java/com/pchmn/materialchips/adapter/FilterableAdapter.java +++ b/library/src/main/java/com/pchmn/materialchips/adapter/FilterableAdapter.java @@ -70,6 +70,13 @@ public int compare(ChipInterface o1, ChipInterface o2) { return mCollator.compare(o1.getLabel(), o2.getLabel()); } }; + // remove chips that do not have label + int count = 0; + for(ChipInterface chipInterface: chipList) { + if(chipInterface.getLabel() == null) + chipList.remove(count); + count++; + } sortList(chipList); mOriginalList.addAll(chipList); mChipList.addAll(chipList);