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

Fix NRE in recently added AssigningSymbolAndItsMemberInSameStatement … #2883

Merged
merged 1 commit into from Oct 1, 2019

Conversation

mavasani
Copy link
Member

@mavasani mavasani commented Oct 1, 2019

…analyzer

Handle null operation type, which is possible for OperationKind.None
Found while dogfooding the latest package

…analyzer

Handle null operation type, which is possible for OperationKind.None
Found while dogfooding the latest package
@mavasani mavasani added this to the vNext milestone Oct 1, 2019
@mavasani mavasani requested review from genlu and dotpaul October 1, 2019 17:59
@@ -50,29 +50,21 @@ private void AnalyzeAssignment(OperationAnalysisContext context)
}

// This analyzer makes sense only for reference type objects
if (operationTarget.Instance?.Type.IsValueType == true)
if (operationTarget.Instance?.Type?.IsReferenceType != true)
Copy link
Member Author

Choose a reason for hiding this comment

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

This is the core fix for the NRE. Other change below is just applying an IDE suggestion to use switch expression.

Copy link
Contributor

@dotpaul dotpaul left a comment

Choose a reason for hiding this comment

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

🚢

@mavasani
Copy link
Member Author

mavasani commented Oct 1, 2019

Thanks @dotpaul

@mavasani mavasani merged commit 4bc7bc6 into dotnet:master Oct 1, 2019
@mavasani mavasani deleted the FixNRE branch October 1, 2019 18:39
@jmarolf jmarolf modified the milestones: vNext, .NET 5 Preview 8 Aug 12, 2020
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.

None yet

3 participants