Skip to content

Fixed null reference exception in Token operator overload #1842

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

Merged
merged 1 commit into from
Sep 7, 2022

Conversation

vlada-shubina
Copy link
Member

Problem:

//given 
Token? token = null;
if (token == default || token == null)
{
    //leads to null ref exception
}

Added check for null in Token operator overload.
Workaround: use token is null instead.

@vlada-shubina vlada-shubina changed the title Fixed null reference exception in Token operator overload Fixed null reference exception in Token operator overload Sep 5, 2022
@KalleOlaviNiemitalo
Copy link

KalleOlaviNiemitalo commented Sep 5, 2022

Fixes #1797, thus competes with #1802

@jonsequitur jonsequitur merged commit 1d98a75 into dotnet:main Sep 7, 2022
@jonsequitur
Copy link
Contributor

jonsequitur commented Sep 7, 2022

Thanks, @vlada-shubina!

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.

3 participants