Fix exception when no SSH stuff is configured
This commit is contained in:
parent
516116f83e
commit
74b03fe846
|
@ -241,6 +241,10 @@ exports.getModule = class SSHServerModule extends LoginServerModule {
|
||||||
|
|
||||||
createServer() {
|
createServer() {
|
||||||
const config = Config();
|
const config = Config();
|
||||||
|
if(true != config.loginServers.ssh.enabled) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const serverConf = {
|
const serverConf = {
|
||||||
hostKeys : [
|
hostKeys : [
|
||||||
{
|
{
|
||||||
|
@ -269,6 +273,10 @@ exports.getModule = class SSHServerModule extends LoginServerModule {
|
||||||
|
|
||||||
listen() {
|
listen() {
|
||||||
const config = Config();
|
const config = Config();
|
||||||
|
if(true != config.loginServers.ssh.enabled) {
|
||||||
|
return true; // no server, but not an error
|
||||||
|
}
|
||||||
|
|
||||||
const port = parseInt(config.loginServers.ssh.port);
|
const port = parseInt(config.loginServers.ssh.port);
|
||||||
if(isNaN(port)) {
|
if(isNaN(port)) {
|
||||||
Log.error( { server : ModuleInfo.name, port : config.loginServers.ssh.port }, 'Cannot load server (invalid port)' );
|
Log.error( { server : ModuleInfo.name, port : config.loginServers.ssh.port }, 'Cannot load server (invalid port)' );
|
||||||
|
|
Loading…
Reference in New Issue