Skip to content

Commit

Permalink
Fix null error (#7412)
Browse files Browse the repository at this point in the history
  • Loading branch information
chidozieononiwu authored Dec 7, 2023
1 parent 1d3f851 commit 1c9239e
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions src/dotnet/APIView/APIViewWeb/Managers/APIRevisionsManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -296,9 +296,13 @@ public async Task GetLineNumbersOfHeadingsOfSectionsWithDiff(string reviewId, AP
{
var RevisionARootNode = RevisionACodeFile.GetCodeLineSectionRoot((int)diffLine.Line.SectionKey);
var RevisionBRootNode = RevisionBCodeFile.GetCodeLineSectionRoot((int)diffLine.OtherLine.SectionKey);
var diffSectionRoot = ComputeSectionDiff(before: RevisionARootNode, after: RevisionBRootNode, beforeFile: RevisionACodeFile, afterFile: RevisionBCodeFile);
if (RevisionACodeFile.ChildNodeHasDiff(diffSectionRoot))
lineNumbersForHeadingOfSectionWithDiff.Add((int)diffLine.Line.LineNumber);

if (RevisionARootNode != null && RevisionBRootNode != null)
{
var diffSectionRoot = ComputeSectionDiff(before: RevisionARootNode, after: RevisionBRootNode, beforeFile: RevisionACodeFile, afterFile: RevisionBCodeFile);
if (RevisionACodeFile.ChildNodeHasDiff(diffSectionRoot))
lineNumbersForHeadingOfSectionWithDiff.Add((int)diffLine.Line.LineNumber);
}
}
}

Expand All @@ -321,9 +325,13 @@ public async Task GetLineNumbersOfHeadingsOfSectionsWithDiff(string reviewId, AP
{
var RevisionBRootNode = RevisionBCodeFile.GetCodeLineSectionRoot((int)diffLine.Line.SectionKey);
var RevisionARootNode = RevisionACodeFile.GetCodeLineSectionRoot((int)diffLine.OtherLine.SectionKey);
var diffSectionRoot = ComputeSectionDiff(before: RevisionBRootNode, after: RevisionARootNode, beforeFile: RevisionBCodeFile, afterFile: RevisionACodeFile);
if (RevisionACodeFile.ChildNodeHasDiff(diffSectionRoot))
lineNumbersForHeadingOfSectionWithDiff.Add((int)diffLine.Line.LineNumber);

if (RevisionARootNode != null && RevisionBRootNode != null)
{
var diffSectionRoot = ComputeSectionDiff(before: RevisionBRootNode, after: RevisionARootNode, beforeFile: RevisionBCodeFile, afterFile: RevisionACodeFile);
if (RevisionACodeFile.ChildNodeHasDiff(diffSectionRoot))
lineNumbersForHeadingOfSectionWithDiff.Add((int)diffLine.Line.LineNumber);
}
}
}

Expand Down

0 comments on commit 1c9239e

Please sign in to comment.