From 9862845f82e705a833673ae08a173c7b3c43223a Mon Sep 17 00:00:00 2001 From: leo Date: Sun, 26 Sep 2021 13:50:06 +0800 Subject: [PATCH] fix: fix crash when repo's remote has no branches --- src/Views/Popups/Pull.xaml.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Views/Popups/Pull.xaml.cs b/src/Views/Popups/Pull.xaml.cs index 745a5ecf..95074c58 100644 --- a/src/Views/Popups/Pull.xaml.cs +++ b/src/Views/Popups/Pull.xaml.cs @@ -60,6 +60,8 @@ namespace SourceGit.Views.Popups { var branches = repo.Branches.Where(x => x.Remote == remote.Name).ToList(); cmbBranches.ItemsSource = branches; + if (branches.Count == 0) return; + if (prefered != null && remote.Name == prefered.Remote) { cmbBranches.SelectedItem = branches.Find(x => x.FullName == prefered.FullName); } else {