RefactoringEssentials icon indicating copy to clipboard operation
RefactoringEssentials copied to clipboard

AddNullCheckCodeRefactoringProvider

Open CmdQ opened this issue 7 years ago • 2 comments

For me the yellow error bar keeps re-appearing and showing me the AddNullCheckCodeRefactoringProvider error, no matter how many times I clicked on “Enable and ignore future errors”. After a couple of edits, it comes back.

The method I'm working on does have one string parameter but does not have/need the null check.

It happens both when editing and when debugging and stepping through code.

System.NullReferenceException : Object reference not set to an instance of an object. at RefactoringEssentials.CSharp.AddNullCheckCodeRefactoringProvider.ConditionContainsNullCheck(ExpressionSyntax condition,ExpressionSyntax identifierToCheck) at RefactoringEssentials.CSharp.AddNullCheckCodeRefactoringProvider.StatementWithConditionContainsNullCheck(SyntaxNode statement,ExpressionSyntax identifierToCheck) at async RefactoringEssentials.CSharp.AddNullCheckCodeRefactoringProvider.ComputeRefactoringsAsync(<Unknown Parameters>) at async Microsoft.CodeAnalysis.CodeRefactorings.CodeRefactoringService.GetRefactoringFromProviderAsync(<Unknown Parameters>)

CmdQ avatar Sep 13 '17 06:09 CmdQ

Hi, it would be very helpful to have a code example and where your cursor is when this happens.

nick-morhun avatar Dec 14 '17 10:12 nick-morhun

Hi. I'm sorry but I don't have the state of that project anymore. In case I experience such behavior again, I'll document everything.

CmdQ avatar Dec 14 '17 12:12 CmdQ