From ae031af16147e88d1c7fbd70e4d98a6168669d54 Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 4 Mar 2019 20:16:45 +0100 Subject: [PATCH] fixing a glitch at third party intents, hopefully fixed #1311 and #1309 --- .../gallery/pro/activities/PhotoVideoActivity.kt | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) 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 82c960d99..1a9f62a45 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 @@ -77,10 +77,12 @@ open class PhotoVideoActivity : SimpleActivity(), ViewPagerFragment.FragmentList val uri = mUri.toString() if (uri.startsWith("content:/") && uri.contains("/storage/")) { val guessedPath = uri.substring(uri.indexOf("/storage/")) - val extras = intent.extras ?: Bundle() - extras.apply { - putString(REAL_FILE_PATH, guessedPath) - intent.putExtras(this) + if (File(guessedPath).exists()) { + val extras = intent.extras ?: Bundle() + extras.apply { + putString(REAL_FILE_PATH, guessedPath) + intent.putExtras(this) + } } }