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

rmdir function not checking if File object listFiles method is throwing null or an empty array #2286

Open
ChandraKAV opened this issue Dec 19, 2024 · 0 comments

Comments

@ChandraKAV
Copy link

Bug Report

Plugin(s)

Filesystem

Capacitor Version

Capacitor v5.7.5

[warn] The bundledWebRuntime configuration option has been deprecated. Can be safely deleted.
💊   Capacitor Doctor  💊 

Latest Dependencies:

  @capacitor/cli: 6.2.0
  @capacitor/core: 6.2.0
  @capacitor/android: 6.2.0
  @capacitor/ios: 6.2.0

Installed Dependencies:

  @capacitor/cli: 5.6.0
  @capacitor/core: 5.7.5
  @capacitor/android: 5.7.5
  @capacitor/ios: 5.7.0

[success] iOS looking great! 👌
[success] Android looking great! 👌

Platform(s)

Android

Current Behavior

App Crash happening when rmdir function is called on a directory that does not exist or a dir that has no files (sometimes)

Expected Behavior

Need to check if listFiles is returning null or an empty array

Other Technical Details

code snippet from FileSystemPlugin.java

if (fileObject.isDirectory() && fileObject.listFiles().length != 0 && !recursive) {
call.reject("Directory is not empty");
return;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants