catch extensions at creating fileoutputstreams

This commit is contained in:
tibbi 2018-03-31 11:40:22 +02:00
parent a6ae985dcf
commit 0ea48bef20

View file

@ -621,7 +621,12 @@ fun BaseSimpleActivity.getFileOutputStreamSync(path: String, mimeType: String, p
val newDocument = documentFile.createFile(mimeType, path.getFilenameFromPath())
applicationContext.contentResolver.openOutputStream(newDocument!!.uri)
} else {
FileOutputStream(targetFile)
try {
FileOutputStream(targetFile)
} catch (e: Exception) {
showErrorToast(e)
null
}
}
}