Skip to content

Commit

Permalink
Ensure we never pass $Null values to replace placeholders
Browse files Browse the repository at this point in the history
  • Loading branch information
MathieuBuisson committed Oct 7, 2017
1 parent 7aec180 commit a81aa16
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ Function Set-PSCodeHealthPlaceholdersValue {
$PlaceholderPattern = '{{{0}}}' -f $Placeholder.Key

# Handling values containing a collection
$PlaceholderValue = If ( $($Placeholder.Value).Count -gt 1 ) { $Placeholder.Value | Out-String } Else { $Placeholder.Value }
$Html = $Html.ForEach('Replace', $PlaceholderPattern, $PlaceholderValue)
$PlaceholderValue = If ( $($Placeholder.Value).Count -ne 1 ) { $Placeholder.Value | Out-String } Else { $Placeholder.Value }
$Html = $Html.ForEach('Replace', $PlaceholderPattern, [string]$PlaceholderValue)
}
$Html
}

0 comments on commit a81aa16

Please sign in to comment.