Skip to content

Fix compact output crash on empty received#475

Merged
SimonCropp merged 2 commits into
mainfrom
Fix-Compact-output-crash-on-empty-received
Jul 14, 2026
Merged

Fix compact output crash on empty received#475
SimonCropp merged 2 commits into
mainfrom
Fix-Compact-output-crash-on-empty-received

Conversation

@SimonCropp

Copy link
Copy Markdown
Member

No description provided.

When the received text is empty the diff is all deletions, so every
DiffPiece.Position is null and Max(_ => _.Position) is null. That made
prefixLength 0 and `new string(' ', prefixLength - 1)` throw
ArgumentOutOfRangeException.

Verify invokes the string comparer before writing the received file, so
the throw suppressed the .received.txt entirely and surfaced as "no
output generated" (#474).

Fall back to a single-digit width when there are no positioned lines, and
add a regression test covering an all-deletion diff.
@SimonCropp SimonCropp added this to the 3.3.1 milestone Jul 14, 2026
@SimonCropp
SimonCropp merged commit bb4bf1c into main Jul 14, 2026
6 checks passed
@SimonCropp
SimonCropp deleted the Fix-Compact-output-crash-on-empty-received branch July 14, 2026 09:31
This was referenced Jul 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant