From 3c834fe5212b2c5e2336f97ea7f55ca1b5423550 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sat, 10 Feb 2018 16:43:47 +0100 Subject: [PATCH] add null checks at search query change updates --- .../simplemobiletools/contacts/fragments/MyViewPagerFragment.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/contacts/fragments/MyViewPagerFragment.kt b/app/src/main/kotlin/com/simplemobiletools/contacts/fragments/MyViewPagerFragment.kt index 5b66c30f..709ff448 100644 --- a/app/src/main/kotlin/com/simplemobiletools/contacts/fragments/MyViewPagerFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/contacts/fragments/MyViewPagerFragment.kt @@ -166,7 +166,7 @@ abstract class MyViewPagerFragment(context: Context, attributeSet: AttributeSet) } fun onSearchQueryChanged(text: String) { - (fragment_list.adapter as ContactsAdapter).apply { + (fragment_list.adapter as? ContactsAdapter)?.apply { val filtered = contactsIgnoringSearch.filter { it.getFullName(startNameWithSurname).contains(text, true) || it.phoneNumbers.any { it.value.contains(text, true) } ||