From 68c6186fa70d17da0bbe1eee1040870eec811a0d Mon Sep 17 00:00:00 2001 From: tibbi Date: Thu, 15 Jun 2017 22:33:11 +0200 Subject: [PATCH] dont do anything if an action menu is clicked at photoVideoActivity without media --- .../simplemobiletools/gallery/activities/PhotoVideoActivity.kt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/PhotoVideoActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/PhotoVideoActivity.kt index 56e39f852..facded0d6 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/PhotoVideoActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/PhotoVideoActivity.kt @@ -136,6 +136,9 @@ open class PhotoVideoActivity : SimpleActivity(), ViewPagerFragment.FragmentList } override fun onOptionsItemSelected(item: MenuItem): Boolean { + if (mMedium == null) + return true + when (item.itemId) { R.id.menu_set_as_wallpaper -> trySetAsWallpaper(File(mMedium!!.path)) R.id.menu_open_with -> openWith(File(mMedium!!.path))