From c33906a874e50b4b7eba704d39cf2e5d22c14175 Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 26 Feb 2018 17:17:04 +0100 Subject: [PATCH] making some views nullable --- .../contacts/activities/MainActivity.kt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/contacts/activities/MainActivity.kt b/app/src/main/kotlin/com/simplemobiletools/contacts/activities/MainActivity.kt index 68c98bca..aa37373e 100644 --- a/app/src/main/kotlin/com/simplemobiletools/contacts/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/contacts/activities/MainActivity.kt @@ -196,13 +196,13 @@ class MainActivity : SimpleActivity(), RefreshContactsListener { MenuItemCompat.setOnActionExpandListener(searchMenuItem, object : MenuItemCompat.OnActionExpandListener { override fun onMenuItemActionExpand(item: MenuItem?): Boolean { - getCurrentFragment().onSearchOpened() + getCurrentFragment()?.onSearchOpened() isSearchOpen = true return true } override fun onMenuItemActionCollapse(item: MenuItem?): Boolean { - getCurrentFragment().onSearchClosed() + getCurrentFragment()?.onSearchClosed() isSearchOpen = false return true } @@ -291,15 +291,15 @@ class MainActivity : SimpleActivity(), RefreshContactsListener { private fun showSortingDialog() { ChangeSortingDialog(this) { - contacts_fragment.initContacts() - favorites_fragment.initContacts() + contacts_fragment?.initContacts() + favorites_fragment?.initContacts() } } fun showFilterDialog() { FilterContactSourcesDialog(this) { - contacts_fragment.forceListRedraw = true - contacts_fragment.initContacts() + contacts_fragment?.forceListRedraw = true + contacts_fragment?.initContacts() } }