Skip to content

fix: Unhandled IOException in DeleteSelectedFiles crashing the app#112

Merged
yasirkula merged 5 commits intoyasirkula:masterfrom
blackyale:master
Apr 24, 2026
Merged

fix: Unhandled IOException in DeleteSelectedFiles crashing the app#112
yasirkula merged 5 commits intoyasirkula:masterfrom
blackyale:master

Conversation

@blackyale
Copy link
Copy Markdown
Contributor

Fixes a crash when trying to delete files that are locked by another process (e.g. OneDrive sync, antivirus). Previously, an unhandled IOException would kill the app. Now the deletion loop catches the exception, logs a warning, and keeps going so the rest of the selected files still get deleted and the file list refreshes properly.

@yasirkula
Copy link
Copy Markdown
Owner

I'm sorry about the delay 🌷 Thank you for your contribution. I'm a bit curious how the code crashes the app instead of throwing an Exception. Do you have any idea?

I have one revision request: can you simplify System.IO.IOException as simply IOException?

@blackyale
Copy link
Copy Markdown
Contributor Author

It is an unhandled exception that is elevated to the application invoking this method. I found it happened only to one user among hundreds but still worth handling it I'd say. I'll add the revision remark you did, thanks a lot for your time and such a great tool you have created.

image

Copy link
Copy Markdown
Contributor Author

@blackyale blackyale left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update IOException remark

@yasirkula
Copy link
Copy Markdown
Owner

I've changed the warning to be an error and provided the file's path in the error log. Thank you for your contribution!

@yasirkula yasirkula merged commit ab8c86c into yasirkula:master Apr 24, 2026
@yasirkula
Copy link
Copy Markdown
Owner

Wow I've managed to create a compiler error. But I'll fix it promptly 🙈

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.

2 participants