add null checks at search query change updates

This commit is contained in:
tibbi 2018-02-10 16:43:47 +01:00
parent c25bfdebcf
commit 3c834fe521
1 changed files with 1 additions and 1 deletions

View File

@ -166,7 +166,7 @@ abstract class MyViewPagerFragment(context: Context, attributeSet: AttributeSet)
} }
fun onSearchQueryChanged(text: String) { fun onSearchQueryChanged(text: String) {
(fragment_list.adapter as ContactsAdapter).apply { (fragment_list.adapter as? ContactsAdapter)?.apply {
val filtered = contactsIgnoringSearch.filter { val filtered = contactsIgnoringSearch.filter {
it.getFullName(startNameWithSurname).contains(text, true) || it.getFullName(startNameWithSurname).contains(text, true) ||
it.phoneNumbers.any { it.value.contains(text, true) } || it.phoneNumbers.any { it.value.contains(text, true) } ||