Skip to content

Commit b6e506d

Browse files
azure-sdkscbedd
andauthored
Gracefully handle when we return no matrix results (#40079)
Co-authored-by: Scott Beddall <[email protected]>
1 parent 582b642 commit b6e506d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

eng/common/scripts/job-matrix/Create-PrJobMatrix.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -253,14 +253,14 @@ if ($directPackages) {
253253
foreach($artifact in $directPackages) {
254254
Write-Host "-> $($artifact.ArtifactName)"
255255
}
256-
$OverallResult += GeneratePRMatrixForBatch -Packages $directPackages
256+
$OverallResult += (GeneratePRMatrixForBatch -Packages $directPackages) ?? @()
257257
}
258258
if ($indirectPackages) {
259259
Write-Host "Discovered $($indirectPackages.Length) indirect packages"
260260
foreach($artifact in $indirectPackages) {
261261
Write-Host "-> $($artifact.ArtifactName)"
262262
}
263-
$OverallResult += GeneratePRMatrixForBatch -Packages $indirectPackages -FullSparseMatrix (-not $SparseIndirect)
263+
$OverallResult += (GeneratePRMatrixForBatch -Packages $indirectPackages -FullSparseMatrix (-not $SparseIndirect)) ?? @()
264264
}
265265
$serialized = SerializePipelineMatrix $OverallResult
266266

0 commit comments

Comments
 (0)