Skip to content

Fix: validate file path in BaseRepository constructor#25

Open
HashidaTKS wants to merge 1 commit into
masterfrom
fix/filepath-validation
Open

Fix: validate file path in BaseRepository constructor#25
HashidaTKS wants to merge 1 commit into
masterfrom
fix/filepath-validation

Conversation

@HashidaTKS

Copy link
Copy Markdown
Owner

問題点

BaseRepository のコンストラクタでファイルパスの検証を行っていなかったため、null や空文字が渡された場合でも構築が成功し、実際の I/O 操作時に不明瞭な例外がスローされていた。

改善内容

  • string.IsNullOrWhiteSpace(statusFilePath) のガード節を追加
  • 無効なパスが渡された場合は ArgumentException を即座にスローし、問題の原因箇所を明確にする

Test plan

  • null を渡した場合に ArgumentException がスローされることを確認
  • 空文字・空白文字を渡した場合に ArgumentException がスローされることを確認
  • 有効なパスを渡した場合は正常に構築されることを確認

🤖 Generated with Claude Code

… 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>
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.

1 participant