fix: pressing Alt+Enter to commit and push in a repository that has no remotes will crash (#1205)

Signed-off-by: leo <longshuang@msn.cn>
This commit is contained in:
leo 2025-04-17 13:30:25 +08:00
parent c231772298
commit 0e967ffc8e
No known key found for this signature in database

View file

@ -1735,7 +1735,7 @@ namespace SourceGit.ViewModels
CommitMessage = string.Empty; CommitMessage = string.Empty;
UseAmend = false; UseAmend = false;
if (autoPush) if (autoPush && _repo.Remotes.Count > 0)
_repo.ShowAndStartPopup(new Push(_repo, null)); _repo.ShowAndStartPopup(new Push(_repo, null));
} }