mirror of
https://github.com/ShareX/ShareX.git
synced 2024-10-02 18:26:27 +13:00
fixed #1228: Throw exception if sftp keypath is invalid
This commit is contained in:
parent
469741ca7f
commit
f1bb4359c3
1 changed files with 6 additions and 1 deletions
|
@ -115,8 +115,13 @@ public bool Connect()
|
|||
{
|
||||
if (client == null)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(Account.Keypath) && File.Exists(Account.Keypath))
|
||||
if (!string.IsNullOrEmpty(Account.Keypath))
|
||||
{
|
||||
if (!File.Exists(Account.Keypath))
|
||||
{
|
||||
throw new FileNotFoundException("Key path is invalid: " + Account.Keypath);
|
||||
}
|
||||
|
||||
PrivateKeyFile keyFile;
|
||||
|
||||
if (string.IsNullOrEmpty(Account.Passphrase))
|
||||
|
|
Loading…
Reference in a new issue