fix #721, check if a file exists before opening it in the viewpager screen

This commit is contained in:
tibbi 2019-04-01 11:49:03 +02:00
parent 0cb331d126
commit b872ca9233

View file

@ -115,7 +115,7 @@ open class PhotoVideoActivity : SimpleActivity(), ViewPagerFragment.FragmentList
} }
} else { } else {
val path = applicationContext.getRealPathFromURI(mUri!!) ?: "" 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) scanPathRecursively(mUri!!.path)
sendViewPagerIntent(path) sendViewPagerIntent(path)
finish() finish()