From b872ca9233b4425d88a8707e6b93ef8a91de1615 Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 1 Apr 2019 11:49:03 +0200 Subject: [PATCH] fix #721, check if a file exists before opening it in the viewpager screen --- .../gallery/pro/activities/PhotoVideoActivity.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/PhotoVideoActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/PhotoVideoActivity.kt index 049576f24..b8632b877 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/PhotoVideoActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/PhotoVideoActivity.kt @@ -115,7 +115,7 @@ open class PhotoVideoActivity : SimpleActivity(), ViewPagerFragment.FragmentList } } else { val path = applicationContext.getRealPathFromURI(mUri!!) ?: "" - if (path != mUri.toString() && path.isNotEmpty() && mUri!!.authority != "mms" && filename.contains('.')) { + if (path != mUri.toString() && path.isNotEmpty() && mUri!!.authority != "mms" && filename.contains('.') && File(path).exists()) { scanPathRecursively(mUri!!.path) sendViewPagerIntent(path) finish()