Skip to content

Commit 5a81eab

Browse files
committed
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>
1 parent b38212a commit 5a81eab

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/Views/CommitMessagePresenter.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,16 +110,17 @@ protected override void OnPointerPressed(PointerPressedEventArgs e)
110110
if (_lastHover != null)
111111
{
112112
var link = _lastHover.Link;
113+
var type = _lastHover.Type;
113114
e.Pointer.Capture(null);
114115

115-
if (_lastHover.Type == Models.InlineElementType.CommitSHA)
116+
if (type == Models.InlineElementType.CommitSHA)
116117
{
117118
var parentView = this.FindAncestorOfType<CommitBaseInfo>();
118119
if (parentView is { DataContext: ViewModels.CommitDetail detail })
119120
{
120121
if (point.Properties.IsLeftButtonPressed)
121122
{
122-
detail.NavigateTo(_lastHover.Link);
123+
detail.NavigateTo(link);
123124
}
124125
else if (point.Properties.IsRightButtonPressed)
125126
{

0 commit comments

Comments
 (0)