check for null resultdata data at third party intents

This commit is contained in:
tibbi 2017-04-12 23:32:54 +02:00
parent 0598d0f34c
commit 4e9e491f13

View file

@ -269,7 +269,7 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener {
override fun onActivityResult(requestCode: Int, resultCode: Int, resultData: Intent?) { override fun onActivityResult(requestCode: Int, resultCode: Int, resultData: Intent?) {
if (resultCode == Activity.RESULT_OK) { if (resultCode == Activity.RESULT_OK) {
if (requestCode == PICK_MEDIA && resultData != null) { if (requestCode == PICK_MEDIA && resultData?.data != null) {
Intent().apply { Intent().apply {
val path = resultData.data.path val path = resultData.data.path
val uri = Uri.fromFile(File(path)) val uri = Uri.fromFile(File(path))