make resultData.data nullable at pick intent result

This commit is contained in:
tibbi 2017-11-09 17:23:47 +01:00
parent f374cfde67
commit 3e7d4b6f5b

View file

@ -451,7 +451,7 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener {
else -> fillIntentPath(resultData, resultIntent) else -> fillIntentPath(resultData, resultIntent)
} }
} else if ((mIsPickImageIntent || mIsPickVideoIntent)) { } else if ((mIsPickImageIntent || mIsPickVideoIntent)) {
val path = resultData.data.path val path = resultData.data?.path
val uri = getFilePublicUri(File(path), BuildConfig.APPLICATION_ID) val uri = getFilePublicUri(File(path), BuildConfig.APPLICATION_ID)
resultIntent.data = uri resultIntent.data = uri
resultIntent.flags = Intent.FLAG_GRANT_READ_URI_PERMISSION resultIntent.flags = Intent.FLAG_GRANT_READ_URI_PERMISSION