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

Unexpected exception when use relative download path #174

Closed
IMJoyJ opened this issue Nov 28, 2024 · 1 comment · Fixed by #175
Closed

Unexpected exception when use relative download path #174

IMJoyJ opened this issue Nov 28, 2024 · 1 comment · Fixed by #175
Assignees
Labels
bug Something isn't working

Comments

@IMJoyJ
Copy link

IMJoyJ commented Nov 28, 2024

protected async Task StartDownload(string fileName)
    string dirName = Path.GetDirectoryName(fileName);
    if (dirName != null)
    {
        Directory.CreateDirectory(dirName); // ensure the folder is existing
    }

Imagine using "current folder" for the download path:
Path.GetDirectoryName("temp.zip") => result: ""
then
Directory.CreateDirectory("") => leads to an exception

Improve:
A quick solution is using
if (string.IsNullOrEmpty(dirName))
instead of
if (dirName != null)

Or...
"The user should just use .\temp.zip instead of temp.zip"
Well, also makes sense, I guess...

@bezzad bezzad self-assigned this Nov 28, 2024
@bezzad bezzad added the bug Something isn't working label Nov 28, 2024
@bezzad bezzad linked a pull request Nov 28, 2024 that will close this issue
@bezzad
Copy link
Owner

bezzad commented Nov 28, 2024

Thank you for your patience. This issue has been resolved in version 3.3.1. Please update to the latest version and test to see if the problem has been addressed. If you continue to experience any issues, feel free to reopen this ticket.

We appreciate your feedback and appreciate your help in improving our project.

Best regards

@bezzad bezzad closed this as completed Nov 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: No status
Development

Successfully merging a pull request may close this issue.

2 participants