Skip to content
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

Add nullable annotation to ResultContext<TOptions>.Result #55948

Merged
merged 2 commits into from
Jun 1, 2024

Conversation

joegoldman2
Copy link
Contributor

Fixes #45594.

  • You've read the Contributor Guide and Code of Conduct.
  • You've included unit or integration tests for your change, where applicable.
  • You've included inline docs for your change, where applicable.
  • There's an open issue for the PR that you are making. If you'd like to propose a new feature or change, please open an issue to discuss the change or find an existing issue.

@dotnet-policy-service dotnet-policy-service bot added the community-contribution Indicates that the PR has been added by a community member label May 29, 2024
Copy link
Member

@halter73 halter73 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! This isn't even one of the white lies where something really is nullable right after construction, but it's not null later when application developers typically see it. It's most often null for the full lifetime of the context unless an event short circuits authentication.

I guess the reason no one noticed until now is that it's typically only read by framework code where we always null check it despite the previously incorrect annotation. It's definitely worth getting right though.

@halter73 halter73 merged commit 83573c7 into dotnet:main Jun 1, 2024
26 checks passed
@dotnet-policy-service dotnet-policy-service bot added this to the 9.0-preview6 milestone Jun 1, 2024
@joegoldman2 joegoldman2 deleted the fix/45594 branch June 1, 2024 06:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-security community-contribution Indicates that the PR has been added by a community member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ResultContext<TOptions>.Result missing nullable annotation
2 participants