From a770ff542d7128add1f25772967c7324d644d1f8 Mon Sep 17 00:00:00 2001 From: leo Date: Thu, 29 Feb 2024 12:16:31 +0800 Subject: [PATCH] fix: avoid endLine out of range --- src/Views/TextDiffView.axaml.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Views/TextDiffView.axaml.cs b/src/Views/TextDiffView.axaml.cs index 0db3cbb2..f6c05526 100644 --- a/src/Views/TextDiffView.axaml.cs +++ b/src/Views/TextDiffView.axaml.cs @@ -852,6 +852,7 @@ namespace SourceGit.Views { var rs = new Models.TextDiffSelection(); var diff = TextDiff; + endLine = Math.Min(endLine, TextDiff.Lines.Count); if (Content is ViewModels.TwoSideTextDiff twoSides) { var target = isOldSide ? twoSides.Old : twoSides.New; var firstContentLine = -1;