Skip to content

Commit

Permalink
Just to be sure.
Browse files Browse the repository at this point in the history
  • Loading branch information
Corniel Nobel committed Oct 9, 2022
1 parent 0c11416 commit b82ca9c
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ protected TestsShouldNotUseThreadSleepBase() : base(DiagnosticId) { }
protected sealed override void Initialize(SonarAnalysisContext context) =>
context.RegisterSyntaxNodeActionInNonGenerated(Language.GeneratedCodeRecognizer, c =>
{
if (IsThreadSleepMethod(Language.Syntax.NodeIdentifier(c.Node).Value.Text)
if (IsThreadSleepMethod(Language.Syntax.NodeIdentifier(c.Node)?.Text)
&& c.SemanticModel.GetSymbolInfo(c.Node).Symbol is IMethodSymbol method
&& method.ContainingType.Is(KnownType.System_Threading_Thread)
&& IsWithinTest(c.Node, c.SemanticModel))
Expand Down

0 comments on commit b82ca9c

Please sign in to comment.