Skip to content

Commit

Permalink
Handle empty files in Test-SampleMetadata
Browse files Browse the repository at this point in the history
  • Loading branch information
heaths authored and azure-sdk committed Apr 15, 2021
1 parent efd80e4 commit 1a9aade
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion eng/common/scripts/Test-SampleMetadata.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,13 @@ process {
}

[string[]] $content = $file | Get-Content
if (!$content[0].StartsWith('---')) {
if (!$content -or !$content[0].StartsWith('---')) {
Write-Verbose "Skipping $($file.FullName): does not contain frontmatter"
continue
}

Write-Verbose "Checking $($file.FullName)"

# Reset metadata and create mutable collections.
$products = [System.Collections.Generic.List[string]]::new()

Expand Down

0 comments on commit 1a9aade

Please sign in to comment.