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 <longshuang@msn.cn>
This commit is contained in:
leo
2025-10-10 10:46:33 +08:00
parent b38212a7d4
commit 5a81eab60d

View File

@@ -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<CommitBaseInfo>();
if (parentView is { DataContext: ViewModels.CommitDetail detail })
{
if (point.Properties.IsLeftButtonPressed)
{
detail.NavigateTo(_lastHover.Link);
detail.NavigateTo(link);
}
else if (point.Properties.IsRightButtonPressed)
{