From a0786bf9cc12f6e1b29078eed8357879e023098d Mon Sep 17 00:00:00 2001 From: leo Date: Tue, 25 Feb 2025 14:37:03 +0800 Subject: [PATCH] fix: pulling with empty repository (no local branch) crashes this app (#1020) Signed-off-by: leo --- src/ViewModels/Repository.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/ViewModels/Repository.cs b/src/ViewModels/Repository.cs index 104ff60b..85b819c4 100644 --- a/src/ViewModels/Repository.cs +++ b/src/ViewModels/Repository.cs @@ -663,6 +663,12 @@ namespace SourceGit.ViewModels return; } + if (_currentBranch == null) + { + App.RaiseException(_fullpath, "Can NOT found current branch!!!"); + return; + } + var pull = new Pull(this, null); if (autoStart && pull.SelectedBranch != null) ShowAndStartPopup(pull);