Skip to content

Commit

Permalink
don't rely on there ALWAYS being an artifact list to pull from. somet…
Browse files Browse the repository at this point in the history
…imes that is totally unspecified. (#8131)

Co-authored-by: Scott Beddall <[email protected]>
  • Loading branch information
azure-sdk and scbedd authored Oct 16, 2024
1 parent 98a3361 commit 58b5bee
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion eng/common/scripts/Package-Properties.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 58b5bee

Please sign in to comment.