diff --git a/eng/common/scripts/Package-Properties.ps1 b/eng/common/scripts/Package-Properties.ps1 index 72810397c94f..62626f786f0b 100644 --- a/eng/common/scripts/Package-Properties.ps1 +++ b/eng/common/scripts/Package-Properties.ps1 @@ -103,8 +103,11 @@ class PackageProps $content = Get-Content -Raw -Path $ymlPath | CompatibleConvertFrom-Yaml if ($content) { $artifacts = $this.GetValueSafely($content, @("extends", "parameters", "Artifacts")) + $artifactForCurrentPackage = $null - $artifactForCurrentPackage = $artifacts | Where-Object { $_["name"] -eq $this.ArtifactName -or $_["name"] -eq $this.Name } + if ($artifacts) { + $artifactForCurrentPackage = $artifacts | Where-Object { $_["name"] -eq $this.ArtifactName -or $_["name"] -eq $this.Name } + } if ($artifactForCurrentPackage) { return [HashTable]$artifactForCurrentPackage