Skip to content

Commit c0ca2d0

Browse files
danieljurekazure-sdk
authored andcommitted
Skip instances where $file is an empty string
1 parent 7e6de14 commit c0ca2d0

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

eng/common/TestResources/build-test-resource-config.yml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -66,14 +66,16 @@ steps:
6666
6767
if ($subConfigFilesRaw) {
6868
$subConfigFiles = $subConfigFilesRaw | ConvertFrom-Json -AsHashtable
69-
# Handle cases where $subConfigFilesRaw converts to an empty string
70-
# instead of an array of strings
71-
if ($subConfigFiles) {
72-
foreach ($file in $subConfigFiles) {
73-
Write-Host "Merging sub config from file: $file"
74-
$subConfig = Get-Content $file | ConvertFrom-Json -AsHashtable
75-
$finalConfig = UpdateSubscriptionConfiguration $finalConfig $subConfig
69+
foreach ($file in $subConfigFiles) {
70+
# In some cases, $file could be an empty string. Get-Content will fail
71+
# if $file is an empty string, so skip those cases.
72+
if (!$file) {
73+
continue
7674
}
75+
76+
Write-Host "Merging sub config from file: $file"
77+
$subConfig = Get-Content $file | ConvertFrom-Json -AsHashtable
78+
$finalConfig = UpdateSubscriptionConfiguration $finalConfig $subConfig
7779
}
7880
}
7981

0 commit comments

Comments
 (0)