Skip to content

Commit 09ed35f

Browse files
author
jantari
committed
fix #87 by removing empty strings after split operation
this will also avoid problems in case there is ever a double-comma or a trailing comma in the rc or rccancel properties. Switching to the .Split() method is safe here because GetAttribute() always returns a string, not null.
1 parent 1b19ff0 commit 09ed35f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

LSUClient.psm1

+3-3
Original file line numberDiff line numberDiff line change
@@ -214,9 +214,9 @@ class PackageInstallInfo {
214214

215215
PackageInstallInfo ([System.Xml.XmlElement]$PackageXML) {
216216
$this.InstallType = $PackageXML.Install.GetAttribute('type')
217-
$this.SuccessCodes = $PackageXML.Install.GetAttribute('rc') -split ','
218-
$this.FailureCodes = $PackageXML.Install.GetAttribute('rcfailure') -split ','
219-
$this.CancelCodes = $PackageXML.Install.GetAttribute('rccancel') -split ','
217+
$this.SuccessCodes = $PackageXML.Install.GetAttribute('rc').Split(',').Where({ $_ }) # Avoids issue #87
218+
$this.FailureCodes = $PackageXML.Install.GetAttribute('rcfailure').Split(',')
219+
$this.CancelCodes = $PackageXML.Install.GetAttribute('rccancel').Split(',').Where({ $_ }) # Avoids issue #87
220220
$this.InfFile = $PackageXML.Install.INFCmd.INFfile
221221
$this.ExtractCommand = $PackageXML.ExtractCommand
222222
$this.Command = $PackageXML.Install.Cmdline.'#text'

0 commit comments

Comments
 (0)