mirror of
https://github.com/SimpleMobileTools/Simple-File-Manager.git
synced 2025-01-29 09:49:24 +01:00
avoid deleting whole sd card content by mistake
This commit is contained in:
parent
1bb8a85fbf
commit
46999432d9
@ -225,7 +225,10 @@ class ItemsFragment : android.support.v4.app.Fragment(), ItemsAdapter.ItemOperat
|
||||
|
||||
if (context.needsStupidWritePermissions(item.absolutePath)) {
|
||||
val document = context.getFileDocument(item.absolutePath, mConfig.treeUri)
|
||||
document.delete()
|
||||
|
||||
// double check we have the uri to the proper file path, not some parent folder
|
||||
if (document.uri.toString().endsWith(item.absolutePath.getFilenameFromPath()) && !document.isDirectory)
|
||||
document.delete()
|
||||
} else {
|
||||
item.delete()
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user