mirror of
https://github.com/adamhathcock/sharpcompress.git
synced 2026-02-03 21:23:38 +00:00
[PR #1140] [MERGED] Replace empty catch blocks with explicit exception handling in TarArchive validation methods #1576
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/adamhathcock/sharpcompress/pull/1140
Author: @Copilot
Created: 1/16/2026
Status: ✅ Merged
Merged: 1/16/2026
Merged by: @adamhathcock
Base:
adam/async-creation← Head:copilot/sub-pr-1132-another-one📝 Commits (2)
302cf2eInitial plan9fa686bFix empty catch blocks in TarArchive.Factory.cs with explicit exception handling📊 Changes
1 file changed (+12 additions, -4 deletions)
View changed files
📝
src/SharpCompress/Archives/Tar/TarArchive.Factory.cs(+12 -4)📄 Description
Addresses code review feedback about empty catch blocks in
TarArchive.Factory.cs. TheIsTarFileandIsTarFileAsyncmethods use catch-all exception handling to detect invalid tar files, but the empty catch blocks obscured intent.Changes
catch { }with explicitcatch (Exception)in both validation methodsThe behavior is unchanged—these methods probe streams and return
falsefor any exception rather than propagating to callers.✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.