mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2024-12-24 20:57:19 -08:00
fix<Pull>: fix crash when repo's remote has no branches
This commit is contained in:
parent
b892dc7c66
commit
9862845f82
1 changed files with 2 additions and 0 deletions
|
@ -60,6 +60,8 @@ namespace SourceGit.Views.Popups {
|
||||||
var branches = repo.Branches.Where(x => x.Remote == remote.Name).ToList();
|
var branches = repo.Branches.Where(x => x.Remote == remote.Name).ToList();
|
||||||
cmbBranches.ItemsSource = branches;
|
cmbBranches.ItemsSource = branches;
|
||||||
|
|
||||||
|
if (branches.Count == 0) return;
|
||||||
|
|
||||||
if (prefered != null && remote.Name == prefered.Remote) {
|
if (prefered != null && remote.Name == prefered.Remote) {
|
||||||
cmbBranches.SelectedItem = branches.Find(x => x.FullName == prefered.FullName);
|
cmbBranches.SelectedItem = branches.Find(x => x.FullName == prefered.FullName);
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue