Skip to content

Commit 97e9849

Browse files
azure-sdkscbedd
andauthored
Handle missing artifacts without exception (#31437)
Sync eng/common directory with azure-sdk-tools for PR Azure/azure-sdk-tools#9179 See [eng/common workflow](https://github.com/Azure/azure-sdk-tools/blob/main/eng/common/README.md#workflow) Co-authored-by: Scott Beddall <[email protected]>
1 parent d0b70a8 commit 97e9849

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

eng/common/scripts/Package-Properties.ps1

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,11 @@ class PackageProps
103103
$content = Get-Content -Raw -Path $ymlPath | CompatibleConvertFrom-Yaml
104104
if ($content) {
105105
$artifacts = $this.GetValueSafely($content, @("extends", "parameters", "Artifacts"))
106+
$artifactForCurrentPackage = $null
106107

107-
$artifactForCurrentPackage = $artifacts | Where-Object { $_["name"] -eq $this.ArtifactName -or $_["name"] -eq $this.Name }
108+
if ($artifacts) {
109+
$artifactForCurrentPackage = $artifacts | Where-Object { $_["name"] -eq $this.ArtifactName -or $_["name"] -eq $this.Name }
110+
}
108111

109112
if ($artifactForCurrentPackage) {
110113
return [HashTable]$artifactForCurrentPackage

0 commit comments

Comments
 (0)