From a7f4049776d9eabe8f5e0c05dffda78e0ca0d2a4 Mon Sep 17 00:00:00 2001 From: Ylian Saint-Hilaire Date: Wed, 24 Jun 2020 12:39:11 -0700 Subject: [PATCH] Fixed server crash when meshcmd.js is missing. --- meshcentral.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meshcentral.js b/meshcentral.js index 323d83a2..0b8f3e30 100644 --- a/meshcentral.js +++ b/meshcentral.js @@ -1977,7 +1977,7 @@ function CreateMeshCentralServer(config, args) { else if (obj.fs.existsSync(obj.path.join(obj.datapath, 'meshcmd.js'))) { meshcmdPath = obj.path.join(obj.datapath, 'meshcmd.js'); meshCmd = obj.fs.readFileSync(meshcmdPath).toString(); } else if ((obj.args.minifycore !== false) && (obj.fs.existsSync(obj.path.join(__dirname, 'agents', 'meshcmd.min.js')))) { meshcmdPath = obj.path.join(__dirname, 'agents', 'meshcmd.min.js'); meshCmd = obj.fs.readFileSync(meshcmdPath).toString(); } else if (obj.fs.existsSync(obj.path.join(__dirname, 'agents', 'meshcmd.js'))) { meshcmdPath = obj.path.join(__dirname, 'agents', 'meshcmd.js'); meshCmd = obj.fs.readFileSync(meshcmdPath).toString(); } - else { obj.defaultMeshCmd = null; if (func != null) { func(false); } } // meshcmd.js not found + else { obj.defaultMeshCmd = null; if (func != null) { func(false); } return; } // meshcmd.js not found meshCmd = meshCmd.replace("'***Mesh*Cmd*Version***'", '\'' + getCurrentVerion() + '\''); // Figure out where the modules_meshcmd folder is.