Skip to content

Commit ecad5f1

Browse files
PaulHigindaxian-dbw
authored andcommitted
Fix null reference exception in ForEach-Object -Parallel input processing (PowerShell#10577)
1 parent 22c6fb4 commit ecad5f1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/System.Management.Automation/engine/InternalCommands.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -509,7 +509,8 @@ private void InitParallelParameterSet()
509509
private void ProcessParallelParameterSet()
510510
{
511511
// Validate piped InputObject
512-
if (_inputObject.BaseObject is ScriptBlock)
512+
if (_inputObject != null &&
513+
_inputObject.BaseObject is ScriptBlock)
513514
{
514515
WriteError(
515516
new ErrorRecord(

0 commit comments

Comments
 (0)