Fix: validate file path in BaseRepository constructor#25
Open
HashidaTKS wants to merge 1 commit into
Open
Conversation
… invalid input Previously, a null or empty statusFilePath would be accepted silently and only fail at the first I/O operation, producing a cryptic exception far from the source. Add an ArgumentException guard at construction time so the problem is caught immediately with a clear message. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
問題点
BaseRepositoryのコンストラクタでファイルパスの検証を行っていなかったため、nullや空文字が渡された場合でも構築が成功し、実際の I/O 操作時に不明瞭な例外がスローされていた。改善内容
string.IsNullOrWhiteSpace(statusFilePath)のガード節を追加ArgumentExceptionを即座にスローし、問題の原因箇所を明確にするTest plan
nullを渡した場合にArgumentExceptionがスローされることを確認ArgumentExceptionがスローされることを確認🤖 Generated with Claude Code