Skip to content
This repository was archived by the owner on Jun 21, 2023. It is now read-only.

Commit dd19d59

Browse files
Merge pull request #2092 from github/fixes/inline-comment-tagger-crash
Fixing InlineCommentTagger Crash
2 parents 7db8896 + beda19b commit dd19d59

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/GitHub.InlineReviews/Tags/InlineCommentTagger.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,12 +95,11 @@ public IEnumerable<ITagSpan<InlineCommentTag>> GetTags(NormalizedSnapshotSpanCol
9595
Dictionary<int, InlineAnnotationModel[]> spanAnnotationsByLine = null;
9696
if (side == DiffSide.Right)
9797
{
98-
var spanAnnotations = file.InlineAnnotations.Where(x =>
98+
var spanAnnotations = file.InlineAnnotations?.Where(x =>
9999
x.EndLine - 1 >= startLine &&
100100
x.EndLine - 1 <= endLine);
101101

102-
spanAnnotationsByLine = spanAnnotations
103-
.GroupBy(model => model.EndLine)
102+
spanAnnotationsByLine = spanAnnotations?.GroupBy(model => model.EndLine)
104103
.ToDictionary(models => models.Key - 1, models => models.ToArray());
105104
}
106105

0 commit comments

Comments
 (0)