Skip to content

fix(cli): guard against a renderer returning no documents#19

Open
Reefact wants to merge 1 commit into
mainfrom
claude/writeoutput-indexoutofrange-bug-vl7h1i
Open

fix(cli): guard against a renderer returning no documents#19
Reefact wants to merge 1 commit into
mainfrom
claude/writeoutput-indexoutofrange-bug-vl7h1i

Conversation

@Reefact

@Reefact Reefact commented Jul 5, 2026

Copy link
Copy Markdown
Owner

WriteOutput accessed documents[0] without checking the list was
non-empty. The IErrorDocumentationRenderer.Render contract promises at
least one document, but a custom renderer can violate it, in which case
documents[0] threw an opaque ArgumentOutOfRangeException.

Add a guard that fails with a clear message naming the offending
renderer format before any documents[0] access.

Co-Authored-By: Claude Opus 4.8 noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_01RZShkZnouh6f1yy6YGaFwx

WriteOutput accessed documents[0] without checking the list was
non-empty. The IErrorDocumentationRenderer.Render contract promises at
least one document, but a custom renderer can violate it, in which case
documents[0] threw an opaque ArgumentOutOfRangeException.

Add a guard that fails with a clear message naming the offending
renderer format before any documents[0] access.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RZShkZnouh6f1yy6YGaFwx
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