From c1c27be39a01499605d93d7b5f2647cb04c09c7d Mon Sep 17 00:00:00 2001 From: leo Date: Thu, 20 Jun 2024 11:11:09 +0800 Subject: [PATCH] fix: crash when click blank area of change list in Information page of CommitDetail (#192) --- src/Views/CommitDetail.axaml.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Views/CommitDetail.axaml.cs b/src/Views/CommitDetail.axaml.cs index a7373acb..1209e41a 100644 --- a/src/Views/CommitDetail.axaml.cs +++ b/src/Views/CommitDetail.axaml.cs @@ -15,6 +15,12 @@ namespace SourceGit.Views if (DataContext is ViewModels.CommitDetail detail) { var datagrid = sender as DataGrid; + if (datagrid.SelectedItem == null) + { + e.Handled = true; + return; + } + detail.ActivePageIndex = 1; detail.SelectedChanges = new() { datagrid.SelectedItem as Models.Change }; }