From 79214c13c7df10567d6e89394c6aa2860110e063 Mon Sep 17 00:00:00 2001 From: Staffan Gustafsson Date: Fri, 3 Feb 2023 10:27:25 +0100 Subject: [PATCH] Fixing null-check in Input/Output handling --- src/platyPS/platyPS.psm1 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/platyPS/platyPS.psm1 b/src/platyPS/platyPS.psm1 index 26810ac4..c7a63712 100644 --- a/src/platyPS/platyPS.psm1 +++ b/src/platyPS/platyPS.psm1 @@ -2867,7 +2867,7 @@ function ConvertPsObjectsToMamlModel } #Get Description - if($Help.description -ne $null) + if($null -ne $Help.description) { $MamlCommandObject.Description = New-Object -TypeName Markdown.MAML.Model.Markdown.SectionBody ( $Help.description | @@ -2930,7 +2930,7 @@ function ConvertPsObjectsToMamlModel $Help.inputTypes.inputType | ForEach-Object { $InputDescription = $_.description $inputtypes = $_.type.name - if ($_.description -eq $null -and $_.type.name -ne $null) + if ($null -eq $_.description -and $null -ne $_.type.name) { $inputtypes = $_.type.name.split("`n", [System.StringSplitOptions]::RemoveEmptyEntries) } @@ -2957,7 +2957,7 @@ function ConvertPsObjectsToMamlModel $Help.returnValues.returnValue | ForEach-Object { $OuputDescription = $_.description $Outputtypes = $_.type.name - if ($_.description -eq $null -and $_.type.name -ne $null) + if ($null -eq $_.description -and $null -ne $_.type.name) { $Outputtypes = $_.type.name.split("`n", [System.StringSplitOptions]::RemoveEmptyEntries) }