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

Closed
ChandraKAV opened this issue Dec 19, 2024 · 2 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;
}

@Ionitron
Copy link
Collaborator

Ionitron commented Jan 8, 2025

This issue needs more information before it can be addressed.
In particular, the reporter needs to provide a minimal sample app that demonstrates the issue.
If no sample app is provided within 15 days, the issue will be closed.

Please see the Contributing Guide for how to create a Sample App.

Thanks!
Ionitron 💙

@Ionitron
Copy link
Collaborator

It looks like this issue didn't get the information it needed, so I'll close it for now. If I made a mistake, sorry! I am just a bot.

Have a great day!
Ionitron 💙

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

3 participants