adding a null check at closing the search

This commit is contained in:
tibbi 2018-01-08 13:26:07 +01:00
parent e9165ad41d
commit fd180fcb53

View file

@ -205,7 +205,9 @@ class MainActivity : SimpleActivity(), RefreshContactsListener {
override fun onPageScrollStateChanged(state: Int) {
if (isSearchOpen) {
getCurrentFragment().onSearchQueryChanged("")
MenuItemCompat.collapseActionView(searchMenuItem)
if (searchMenuItem != null) {
MenuItemCompat.collapseActionView(searchMenuItem)
}
}
}