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

Nullability for AndroidMessageHandler.RequestNeedsAuthorization #7454

Merged
merged 2 commits into from
Oct 14, 2022

Conversation

mstefarov
Copy link
Contributor

My project uses AndroidMessageHandler. Currently, idiomatic code like this produces a nullability warning:

if (handler.RequestNeedsAuthorization)
    handler.PreAuthenticationData = handler.RequestedAuthentication[0];

This PR adds a MemberNotNullWhen attribute that allows RequestedAuthentication to be used without a null-check after testing RequestNeedsAuthorization.

…ation

The annotation allows RequestedAuthentication to be used without a null-check after testing RequestNeedsAuthorization, when nullability analysis is enabled.
@mstefarov mstefarov requested a review from grendello as a code owner October 11, 2022 16:11
@jonathanpeppers
Copy link
Member

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Co-authored-by: Jonathan Peppers <jonathan.peppers@gmail.com>
@jonathanpeppers
Copy link
Member

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@jonathanpeppers jonathanpeppers merged commit 91669a4 into dotnet:main Oct 14, 2022
@jonathanpeppers
Copy link
Member

Thanks for your contribution!

grendello added a commit to grendello/xamarin-android that referenced this pull request Oct 17, 2022
* main:
  [Mono.Android] nullability for AndroidMessageHandler.RequestNeedsAuthorization (dotnet#7454)
  [Xamarin.Android.Build.Tasks] Fix up `ToJniName` to use `cache`. (dotnet#7460)
  Bump to xamarin/android-api-docs@52d85154 (dotnet#7459)
  Bump to xamarin/xamarin-android-tools/main@9f56dec (dotnet#7456)
grendello added a commit to grendello/xamarin-android that referenced this pull request Oct 18, 2022
* main:
  [Mono.Android] nullability for AndroidMessageHandler.RequestNeedsAuthorization (dotnet#7454)
  [Xamarin.Android.Build.Tasks] Fix up `ToJniName` to use `cache`. (dotnet#7460)
  Bump to xamarin/android-api-docs@52d85154 (dotnet#7459)
  Bump to xamarin/xamarin-android-tools/main@9f56dec (dotnet#7456)
@github-actions github-actions bot locked and limited conversation to collaborators Jan 24, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants