From 0ee62509329a9dc66b2200f6cd9c1dd5150b643b Mon Sep 17 00:00:00 2001 From: Chidozie Ononiwu <31145988+chidozieononiwu@users.noreply.github.com> Date: Wed, 29 May 2024 10:33:34 -0700 Subject: [PATCH] Resolve bug in Conversation Page (#8343) --- .../Pages/Assemblies/Conversation.cshtml | 33 ++++++++++--------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/src/dotnet/APIView/APIViewWeb/Pages/Assemblies/Conversation.cshtml b/src/dotnet/APIView/APIViewWeb/Pages/Assemblies/Conversation.cshtml index 21b33566a93..62383d277cd 100644 --- a/src/dotnet/APIView/APIViewWeb/Pages/Assemblies/Conversation.cshtml +++ b/src/dotnet/APIView/APIViewWeb/Pages/Assemblies/Conversation.cshtml @@ -102,22 +102,25 @@ { int indexA = Model.SampleLines.Count() - Math.Abs(revision.Key.sampleRevisionNumber - skipped); int indexB = int.Parse(thread.Comments.First().ElementId.Split("-").Last()) - 1; - @if (thread.Comments.Any()) - { - var elementId = thread.LineId; + if (Model.SampleLines.Count() > indexA && Model.SampleLines.ElementAt(indexA).Count() > indexB) + { + @if (thread.Comments.Any()) + { + var elementId = thread.LineId; - - - - @Html.Raw(Model.SampleLines.ElementAt(indexA).ElementAt(indexB)) - - - - } - + + + + @Html.Raw(Model.SampleLines.ElementAt(indexA).ElementAt(indexB)) + + + + } + + } }