From da1abaee162a2d64b650c97d6626b24423c82cf2 Mon Sep 17 00:00:00 2001 From: leo Date: Thu, 5 Aug 2021 09:04:20 +0800 Subject: [PATCH] fix: fix crash reported by https://gitee.com/sourcegit/sourcegit/issues/I43Y33 --- src/Views/Widgets/Histories.xaml.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Views/Widgets/Histories.xaml.cs b/src/Views/Widgets/Histories.xaml.cs index 7816c4d1..7e136c37 100644 --- a/src/Views/Widgets/Histories.xaml.cs +++ b/src/Views/Widgets/Histories.xaml.cs @@ -36,7 +36,7 @@ namespace SourceGit.Views.Widgets { foreach (var item in commitList.ItemsSource) { var c = item as Models.Commit; - if (c.SHA.StartsWith(commit, StringComparison.Ordinal)) { + if (c != null && c.SHA.StartsWith(commit, StringComparison.Ordinal)) { commitList.SelectedItem = c; commitList.ScrollIntoView(c); break;