diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt index 013311afc..ef0a5ffad 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt @@ -451,7 +451,7 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener { else -> fillIntentPath(resultData, resultIntent) } } else if ((mIsPickImageIntent || mIsPickVideoIntent)) { - val path = resultData.data.path + val path = resultData.data?.path val uri = getFilePublicUri(File(path), BuildConfig.APPLICATION_ID) resultIntent.data = uri resultIntent.flags = Intent.FLAG_GRANT_READ_URI_PERMISSION