add some null checks at the fragments

This commit is contained in:
tibbi 2018-02-21 15:32:03 +01:00
parent 29d316f6f4
commit 8a4c4f9324
1 changed files with 1 additions and 1 deletions

View File

@ -193,7 +193,7 @@ abstract class MyViewPagerFragment(context: Context, attributeSet: AttributeSet)
}
fun onSearchClosed() {
(fragment_list.adapter as ContactsAdapter).updateItems(contactsIgnoringSearch)
(fragment_list.adapter as? ContactsAdapter)?.updateItems(contactsIgnoringSearch)
if (this is FavoritesFragment) {
fragment_placeholder.text = activity?.getString(R.string.no_favorites)
}