Fix non-fatal null exception when no extra parameters are passed.

This commit is contained in:
jbeisner 2018-01-23 23:59:31 +00:00
parent 34748d5a12
commit 954e2de29e

View file

@ -30,11 +30,14 @@ if($Help)
# The first 'pass' call to "dotnet msbuild build.proj" has a hard-coded "WriteDynamicPropsToStaticPropsFiles" target
# therefore, this call should not have other targets defined. Remove all targets passed in as 'extra parameters'.
$ExtraParametersNoTargets = ""
foreach ($param in $ExtraParameters.split())
if ($ExtraParameters)
{
if((-not $param.StartsWith("/t")) -and (-not $param.StartsWith("/T")))
foreach ($param in $ExtraParameters.split())
{
$ExtraParametersNoTargets += "{0} " -f $param
if((-not $param.StartsWith("/t")) -and (-not $param.StartsWith("/T")))
{
$ExtraParametersNoTargets += "{0} " -f $param
}
}
}