-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Fix StringSegment.Buffer can be null
#57858
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Note regarding the This serves as a reminder for when your PR is modifying a ref *.cs file and adding/modifying public APIs, to please make sure the API implementation in the src *.cs file is documented with triple slash comments, so the PR reviewers can sign off that change. |
|
Tagging subscribers to this area: @eerhardt, @maryamariyan Issue DetailsAddresses: #57395 (comment)
|
src/libraries/Microsoft.Extensions.Primitives/src/StringSegment.cs
Outdated
Show resolved
Hide resolved
…t.cs Co-authored-by: Günther Foidl <[email protected]>
|
Perhaps also add a test where null is passed to .ctor(String), and assert that:
|
|
There is one already: https://github.com/dotnet/runtime/blob/main/src/libraries/Microsoft.Extensions.Primitives/tests/StringSegmentTest.cs#L164 Update: Added more asserts in it |
|
@maxkoshevoi Missed that one, thx. |
src/libraries/Microsoft.Extensions.Primitives/src/StringSegment.cs
Outdated
Show resolved
Hide resolved
src/libraries/Microsoft.Extensions.Primitives/tests/StringSegmentTest.cs
Outdated
Show resolved
Hide resolved
src/libraries/Microsoft.Extensions.Primitives/tests/StringSegmentTest.cs
Show resolved
Hide resolved
|
FYI this PR is blocking the runtime -> aspnetcore merge: dotnet/aspnetcore#35547 If it is in a good state (@eerhardt or @stephentoub could you review the latest changes?) then it would be great to get it merged and unblock updates. |
|
Thanks for fixing it. |
Addresses: #57395 (comment)
BuffernullableEquals(text)returnstrueif bothBufferandtextare null