Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit eafc7197 authored by tibbi's avatar tibbi
Browse files

try catching exceptions thrown at getting a public uri at openFile

parent 68a68a16
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -187,7 +187,12 @@ fun Activity.openEditor(uri: Uri, applicationId: String) {
}

fun Activity.openFile(uri: Uri, forceChooser: Boolean, applicationId: String) {
    val newUri = ensurePublicUri(uri, applicationId)
    val newUri = try {
        ensurePublicUri(uri, applicationId)
    } catch (e: Exception) {
        showErrorToast(e)
        return
    }
    val mimeType = getUriMimeType(uri, newUri)
    Intent().apply {
        action = Intent.ACTION_VIEW