mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2024-12-24 20:57:19 -08:00
Merge pull request #355 from gadfly3173/fix/edit-remote
fix: remove null-check of sshKey in EditRemote
This commit is contained in:
commit
760fd5a3f0
1 changed files with 1 additions and 4 deletions
|
@ -93,11 +93,8 @@ namespace SourceGit.ViewModels
|
||||||
|
|
||||||
public static ValidationResult ValidateSSHKey(string sshkey, ValidationContext ctx)
|
public static ValidationResult ValidateSSHKey(string sshkey, ValidationContext ctx)
|
||||||
{
|
{
|
||||||
if (ctx.ObjectInstance is EditRemote edit && edit.UseSSH)
|
if (ctx.ObjectInstance is EditRemote { _useSSH: true } && !string.IsNullOrEmpty(sshkey))
|
||||||
{
|
{
|
||||||
if (string.IsNullOrEmpty(sshkey))
|
|
||||||
return new ValidationResult("SSH private key is required");
|
|
||||||
|
|
||||||
if (!File.Exists(sshkey))
|
if (!File.Exists(sshkey))
|
||||||
return new ValidationResult("Given SSH private key can NOT be found!");
|
return new ValidationResult("Given SSH private key can NOT be found!");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue