Fix _port not parsing from connection string
This commit is contained in:
@@ -41,7 +41,11 @@ namespace LeafWeb.Core.Remote
|
||||
var conn = new DbConnectionStringBuilder {ConnectionString = connectionString};
|
||||
|
||||
_host = conn["host"] as string;
|
||||
_port = int.Parse(conn["port"] as string ?? "22"); // default 22
|
||||
// TODO: fix this, exception when port is not present
|
||||
if (conn.ContainsKey("port"))
|
||||
_port = int.Parse(conn["port"] as string ?? "22"); // default 22
|
||||
else
|
||||
_port = 22;
|
||||
var username = conn["username"] as string;
|
||||
var password = conn["password"] as string;
|
||||
_connectionInfo = new PasswordConnectionInfo(_host, _port, username, password);
|
||||
|
||||
Reference in New Issue
Block a user