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() {