dont do anything if an action menu is clicked at photoVideoActivity without media

This commit is contained in:
tibbi 2017-06-15 22:33:11 +02:00
parent 7772577883
commit 68c6186fa7

View file

@ -136,6 +136,9 @@ open class PhotoVideoActivity : SimpleActivity(), ViewPagerFragment.FragmentList
} }
override fun onOptionsItemSelected(item: MenuItem): Boolean { override fun onOptionsItemSelected(item: MenuItem): Boolean {
if (mMedium == null)
return true
when (item.itemId) { when (item.itemId) {
R.id.menu_set_as_wallpaper -> trySetAsWallpaper(File(mMedium!!.path)) R.id.menu_set_as_wallpaper -> trySetAsWallpaper(File(mMedium!!.path))
R.id.menu_open_with -> openWith(File(mMedium!!.path)) R.id.menu_open_with -> openWith(File(mMedium!!.path))