-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Fix StringSegment.Buffer
can be null
#57858
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)
Buffer
nullableEquals(text)
returnstrue
if bothBuffer
andtext
are null