fix: pulling with empty repository (no local branch) crashes this app (#1020)

Signed-off-by: leo <longshuang@msn.cn>
This commit is contained in:
leo 2025-02-25 14:37:03 +08:00
parent 4d740f4731
commit a0786bf9cc
No known key found for this signature in database

View file

@ -663,6 +663,12 @@ namespace SourceGit.ViewModels
return; return;
} }
if (_currentBranch == null)
{
App.RaiseException(_fullpath, "Can NOT found current branch!!!");
return;
}
var pull = new Pull(this, null); var pull = new Pull(this, null);
if (autoStart && pull.SelectedBranch != null) if (autoStart && pull.SelectedBranch != null)
ShowAndStartPopup(pull); ShowAndStartPopup(pull);