From 5251c27034334a9ab09916f67d169329447d9fb4 Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Wed, 3 Jul 2024 17:51:11 -0400 Subject: [PATCH] Sync eng/common directory with azure-sdk-tools for PR 8516 (#5752) * Ensure subConfigFiles is not an empty string * Skip instances where $file is an empty string --------- Co-authored-by: Daniel Jurek --- eng/common/TestResources/build-test-resource-config.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/eng/common/TestResources/build-test-resource-config.yml b/eng/common/TestResources/build-test-resource-config.yml index c183bf048..56d7fa4e9 100644 --- a/eng/common/TestResources/build-test-resource-config.yml +++ b/eng/common/TestResources/build-test-resource-config.yml @@ -68,6 +68,12 @@ steps: if ($subConfigFilesRaw) { $subConfigFiles = $subConfigFilesRaw | ConvertFrom-Json -AsHashtable foreach ($file in $subConfigFiles) { + # In some cases, $file could be an empty string. Get-Content will fail + # if $file is an empty string, so skip those cases. + if (!$file) { + continue + } + Write-Host "Merging sub config from file: $file" $subConfig = Get-Content $file | ConvertFrom-Json -AsHashtable $finalConfig = UpdateSubscriptionConfiguration $finalConfig $subConfig