From 04c9214fc056617a7bb377126df4c0255b600f29 Mon Sep 17 00:00:00 2001 From: Gadfly Date: Mon, 12 Aug 2024 19:28:01 +0800 Subject: [PATCH] fix: remove null-check of sshKey in EditRemote --- src/ViewModels/EditRemote.cs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/ViewModels/EditRemote.cs b/src/ViewModels/EditRemote.cs index 0004cca4..0a514324 100644 --- a/src/ViewModels/EditRemote.cs +++ b/src/ViewModels/EditRemote.cs @@ -93,11 +93,8 @@ namespace SourceGit.ViewModels 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)) return new ValidationResult("Given SSH private key can NOT be found!"); }