Handle missing artifacts without exception (#2941)
Co-authored-by: Scott Beddall <scbedd@microsoft.com>
This commit is contained in:
Родитель
43ff1ffe31
Коммит
5065d46817
|
@ -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
|
||||
|
|
Загрузка…
Ссылка в новой задаче