fix<Remote>: fix crash when open add remote dialog

This commit is contained in:
leo 2021-10-21 15:56:22 +08:00
parent 94d97c36ea
commit d5ff070505

View file

@ -28,7 +28,7 @@ namespace SourceGit.Views.Popups {
InitializeComponent(); InitializeComponent();
ruleName.Repo = repo; ruleName.Repo = repo;
if (RemoteURL.StartsWith("git@")) { if (!string.IsNullOrEmpty(RemoteURL) && RemoteURL.StartsWith("git@")) {
txtSSHKey.Text = new Commands.Config(repo.Path).Get($"remote.{remote.Name}.sshkey"); txtSSHKey.Text = new Commands.Config(repo.Path).Get($"remote.{remote.Name}.sshkey");
} else { } else {
txtSSHKey.Text = ""; txtSSHKey.Text = "";