Skip to content

Commit a67bd13

Browse files
committed
Update Rules/ReviewUnusedParameter.cs
1 parent 2a92627 commit a67bd13

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Rules/ReviewUnusedParameter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ public IEnumerable<DiagnosticRecord> AnalyzeScript(Ast ast, string fileName)
126126
);
127127
// If the parameter has the ValueFromPipeline attribute and the scriptblock has a process block with
128128
// $_ or $PSItem usage, then the parameter is considered used
129-
if (valueFromPipeline?.GetValue() && hasProcessBlockWithPSItemOrUnderscore)
129+
if (valueFromPipeline != null && valueFromPipeline.GetValue() && hasProcessBlockWithPSItemOrUnderscore)
130130

131131
{
132132
continue;

0 commit comments

Comments
 (0)