fixed #1228: Throw exception if sftp keypath is invalid

This commit is contained in:
Jaex 2016-01-08 17:52:31 +02:00
parent 469741ca7f
commit f1bb4359c3

View file

@ -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))