Skip to content

fix(build): suppress nullable warnings on JsonElement? .Value access#3316

Merged
dgozman merged 1 commit into
microsoft:mainfrom
dgozman:fix-build-nullable-warnings
May 21, 2026
Merged

fix(build): suppress nullable warnings on JsonElement? .Value access#3316
dgozman merged 1 commit into
microsoft:mainfrom
dgozman:fix-build-nullable-warnings

Conversation

@dgozman
Copy link
Copy Markdown
Collaborator

@dgozman dgozman commented May 21, 2026

Summary

  • The 1.60 driver roll started failing the noble Docker build (which uses .NET SDK 10) and the firefox/ubuntu-latest build with CS8629/CS8600/CS8603 errors on the long-standing (await SendMessageToServerAsync(...)).Value.GetProperty(...) pattern.
  • Add the null-forgiving operator before .Value so the new Roslyn null-flow analysis is satisfied; runtime behavior is unchanged since these responses are always non-null in the success path.

Fixes the failing checks on 9c36b8d.

Newer Roslyn (in .NET SDK 10 used by the noble Docker image, and the
8.0.421 SDK in CI) now flags CS8629 on the
(await SendMessageToServerAsync(...)).Value.GetProperty(...) pattern.
Add the null-forgiving operator since the server response is always
non-null in the success path.
@dgozman dgozman merged commit 5581a8d into microsoft:main May 21, 2026
15 of 16 checks passed
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