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

Use toAbsolutePath in FileProxy#downloadToPath #2239

Merged
merged 2 commits into from
Sep 3, 2022
Merged

Conversation

MinnDevelopment
Copy link
Member

Pull Request Etiquette

Changes

  • Internal code
  • Library interface (affecting end-user code)
  • Documentation
  • Other: _____

Closes Issue: NaN

Description

Fixes bug with resolving parent directory of paths for FileProxy

Exception

java.lang.NullPointerException: Cannot invoke "java.nio.file.Path.getFileSystem()" because "path" is null
        at java.base/java.nio.file.Files.provider(Files.java:105)
        at java.base/java.nio.file.Files.exists(Files.java:2520)
        at net.dv8tion.jda.api.utils.FileProxy.downloadToPath(FileProxy.java:202)
        at net.dv8tion.jda.api.utils.FileProxy.downloadToPath(FileProxy.java:310)
        at net.dv8tion.jda.api.utils.FileProxy.downloadToPath(FileProxy.java:196)
        at net.dv8tion.jda.api.utils.FileProxy.downloadToPath(FileProxy.java:256)

Caused by path.getParent() being used on Paths.get("thumbnail.jpg") which is a relative path without defined parent folder.

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

Successfully merging this pull request may close these issues.

None yet

1 participant