From 74b03fe846199cac9c296baff2db474d72f02f78 Mon Sep 17 00:00:00 2001 From: Bryan Ashby Date: Mon, 12 Nov 2018 22:05:36 -0700 Subject: [PATCH] Fix exception when no SSH stuff is configured --- core/servers/login/ssh.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/core/servers/login/ssh.js b/core/servers/login/ssh.js index f9186cf9..72f91a2a 100644 --- a/core/servers/login/ssh.js +++ b/core/servers/login/ssh.js @@ -241,6 +241,10 @@ exports.getModule = class SSHServerModule extends LoginServerModule { createServer() { const config = Config(); + if(true != config.loginServers.ssh.enabled) { + return; + } + const serverConf = { hostKeys : [ { @@ -269,6 +273,10 @@ exports.getModule = class SSHServerModule extends LoginServerModule { listen() { const config = Config(); + if(true != config.loginServers.ssh.enabled) { + return true; // no server, but not an error + } + const port = parseInt(config.loginServers.ssh.port); if(isNaN(port)) { Log.error( { server : ModuleInfo.name, port : config.loginServers.ssh.port }, 'Cannot load server (invalid port)' );