Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix NullPointerException thrown on deleting folders outside storage #1110

Merged
merged 4 commits into from
Mar 23, 2018

Conversation

TranceLove
Copy link
Collaborator

Fixes #1102. Deleting folders outside storage area is still not possible (either with or without root) after this change, but you'll get an error Toast instead of an app crash.

I'm still not sure if I should fix deleting folders outside storage with root (currently calls to HybridFile.delete() never seen went to RootUtils.delete()) as it is dangerous. That will be in another PR anyway.

Changes:

  • Code cleanups at FileUtil: remove rmdir1() and deleteFilesInFolder()
  • Fix FileUtil.rmdir()
  • Fix DeleteTask, display error Toast on problem during deleting folder

Fixes TeamAmaze#1102. Deleting folders outside storage area is still not possible (either with or without root) after this change, but you'll get an error Toast instead of an app crash.

- Code cleanups at FileUtil: remove rmdir1() and deleteFilesInFolder()
- Fix FileUtil.rmdir()
- Fix DeleteTask, display error Toast on problem during deleting folder
@VishalNehra
Copy link
Member

It shouldn't try to delete the file if root is not enabled. Showing an error is fine enough.

@EmmanuelMess
Copy link
Member

Will make a pull request later, with some corrections.

@EmmanuelMess EmmanuelMess merged commit dc5be9f into TeamAmaze:master Mar 23, 2018
@TranceLove TranceLove deleted the bugfix/issue1102 branch February 24, 2020 03:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

NullPointerException in com.amaze.filemanager.filesystem.FileUtil.deleteFilesInFolder
3 participants