Skip to content

Commit d07acf0

Browse files
CopilotYunchuWang
andcommitted
Add null check for TargetMethod per code review feedback
Co-authored-by: YunchuWang <[email protected]>
1 parent 4f8cf55 commit d07acf0

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Analyzers/Orchestration/GetInputOrchestrationAnalyzer.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,11 @@ protected override void VisitMethod(SemanticModel semanticModel, SyntaxNode meth
5151

5252
foreach (IInvocationOperation operation in methodOperation.Descendants().OfType<IInvocationOperation>())
5353
{
54-
IMethodSymbol method = operation.TargetMethod;
54+
IMethodSymbol? method = operation.TargetMethod;
55+
if (method == null)
56+
{
57+
continue;
58+
}
5559

5660
// Check if this is a call to GetInput<T>() on TaskOrchestrationContext
5761
if (method.Name != "GetInput" || !method.IsGenericMethod)

0 commit comments

Comments
 (0)