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

Commit 15d80062 authored by tibbi's avatar tibbi
Browse files

adding some crashfixes

parent dec685f3
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -562,7 +562,11 @@ fun BaseSimpleActivity.getFileOutputStream(fileDirItem: FileDirItem, callback: (
            }
        }
    } else {
        try {
            callback(FileOutputStream(File(fileDirItem.path)))
        } catch (e: Exception) {
            callback(null)
        }
    }
}

+5 −1
Original line number Diff line number Diff line
@@ -135,7 +135,11 @@ fun Context.getMyFileUri(file: File): Uri {
fun Context.tryFastDocumentDelete(path: String, allowDeleteFolder: Boolean): Boolean {
    val document = getFastDocumentFile(path)
    return if (document?.isFile == true || allowDeleteFolder) {
        try {
            DocumentsContract.deleteDocument(contentResolver, document?.uri)
        } catch (e: Exception) {
            false
        }
    } else {
        false
    }