From 0fa4cb58444dcba71e5784310ab25b81440728b8 Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 8 Jan 2018 13:25:01 +0100 Subject: [PATCH] adding a null check at closing search --- .../com/simplemobiletools/gallery/activities/MediaActivity.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt index 47f9908f4..55d068a87 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt @@ -137,7 +137,9 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener { override fun onStop() { super.onStop() - MenuItemCompat.collapseActionView(mSearchMenuItem) + if (mSearchMenuItem != null) { + MenuItemCompat.collapseActionView(mSearchMenuItem) + } } override fun onDestroy() {