fix: make Join(items, separator, nullItemHandling) reject a null separator [patch] - #145
Merged
Merged
Conversation
…rator [patch] The three-argument overload documented ArgumentNullException for a null separator but passed it straight to string.Join, which treats null as "". It now carries the same guard as the two-argument overload. Fixes #144 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VwgZGoivWyqL4pWDsenTPm
|
This was referenced Sep 29, 2026
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.



Join(items, null, <any NullItemHandling>)now throwsArgumentNullExceptionwithParamName == "separator", as its XML docs say. Before this, the null separator went straight intostring.Join, which treats it as"", sonew[] { "a", "b" }.Join(null!, NullItemHandling.Remove)returned"ab".The guard is the same one the two-argument overload already has. It runs before the
NullItemHandling.Throwscan, so a null separator is reported even when the items also contain a null.Tests
JoinWithNullItemHandlingThrowsArgumentNullExceptionWhenSeparatorIsNullcoversRemove,Include, andThrow, and checksParamName.dotnet buildis clean on every target framework.Fixes #144
🤖 Generated with Claude Code
https://claude.ai/code/session_01VwgZGoivWyqL4pWDsenTPm
Generated by Claude Code