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

Commit 7ed670b2 authored by tibbi's avatar tibbi
Browse files

catch exceptions thrown at deleting document files

parent 9c1680a5
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -360,7 +360,10 @@ fun Context.trySAFFileDelete(fileDirItem: FileDirItem, allowDeleteFolder: Boolea
    if (!fileDeleted) {
        val document = getDocumentFile(fileDirItem.path)
        if (document != null && (fileDirItem.isDirectory == document.isDirectory)) {
            try {
                fileDeleted = (document.isFile == true || allowDeleteFolder) && DocumentsContract.deleteDocument(applicationContext.contentResolver, document.uri)
            } catch (ignored: Exception) {
            }
        }
    }