diff --git a/Build/Agent/Build-RenderArtifactComment.ps1 b/Build/Agent/Build-RenderArtifactComment.ps1 index 87bdddd781..ef72834389 100644 --- a/Build/Agent/Build-RenderArtifactComment.ps1 +++ b/Build/Agent/Build-RenderArtifactComment.ps1 @@ -122,7 +122,7 @@ function Get-PreviousCommentBody { $owner = $repositoryParts[0] $repo = $repositoryParts[1] $commentsUri = "$GitHubApiUrl/repos/$owner/$repo/issues/$pullRequestNumber/comments?per_page=100" - $comments = @(Invoke-GitHubApi -Method Get -Uri $commentsUri) + $comments = @(Invoke-GitHubApi -Method Get -Uri $commentsUri) | Where-Object { $null -ne $_ } $latestMatchingCommentBody = $null foreach ($comment in $comments) { if ($comment.body -and $comment.body.Contains($StickyCommentMarker)) {