From 5a81eab60de83ecf382b63a2286dbb4a855ec313 Mon Sep 17 00:00:00 2001 From: leo Date: Fri, 10 Oct 2025 10:46:33 +0800 Subject: [PATCH] fix: NRE raised while clicking the issue link in commit detail message This is because that `e.Pointer.Capture(null)` will raise the `PointerExited` event Signed-off-by: leo --- src/Views/CommitMessagePresenter.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Views/CommitMessagePresenter.cs b/src/Views/CommitMessagePresenter.cs index 6457394b..056a43f7 100644 --- a/src/Views/CommitMessagePresenter.cs +++ b/src/Views/CommitMessagePresenter.cs @@ -110,16 +110,17 @@ namespace SourceGit.Views if (_lastHover != null) { var link = _lastHover.Link; + var type = _lastHover.Type; e.Pointer.Capture(null); - if (_lastHover.Type == Models.InlineElementType.CommitSHA) + if (type == Models.InlineElementType.CommitSHA) { var parentView = this.FindAncestorOfType(); if (parentView is { DataContext: ViewModels.CommitDetail detail }) { if (point.Properties.IsLeftButtonPressed) { - detail.NavigateTo(_lastHover.Link); + detail.NavigateTo(link); } else if (point.Properties.IsRightButtonPressed) {