From e2c5c43fd0ddb52c7c8e7b89f458790769de1542 Mon Sep 17 00:00:00 2001 From: Scott Beddall Date: Tue, 15 Oct 2024 14:57:53 -0700 Subject: [PATCH] don't rely on there ALWAYS being an artifact list to pull from. sometimes that is totally unspecified. --- eng/common/scripts/Package-Properties.ps1 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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