Fix null reference exception in ForEach-Object -Parallel input processing (#10577)

This commit is contained in:
Paul Higinbotham
2019-09-20 10:50:07 -07:00
committed by Dongbo Wang
parent 22c6fb4a87
commit ecad5f105d
@@ -509,7 +509,8 @@ namespace Microsoft.PowerShell.Commands
private void ProcessParallelParameterSet()
{
// Validate piped InputObject
if (_inputObject.BaseObject is ScriptBlock)
if (_inputObject != null &&
_inputObject.BaseObject is ScriptBlock)
{
WriteError(
new ErrorRecord(