From 17fd0a096376b038ad44bba738841bd594854155 Mon Sep 17 00:00:00 2001 From: Ylian Saint-Hilaire Date: Tue, 28 Jan 2020 09:41:35 -0800 Subject: [PATCH] Fixed server crash when meshcentral-web has no translations. --- webserver.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/webserver.js b/webserver.js index d55c2ed9..02682c2b 100644 --- a/webserver.js +++ b/webserver.js @@ -4398,9 +4398,8 @@ module.exports.CreateWebServer = function (parent, db, args, certificates) { } // See if there are any custom rending pages that will override the default ones - if (obj.parent.webViewsOverridePath != null) { - translateFolder = null; - if (obj.fs.existsSync(obj.path.join(obj.parent.webViewsOverridePath, 'translations'))) { translateFolder = obj.path.join(obj.parent.webViewsOverridePath, 'translations'); } + if ((obj.parent.webViewsOverridePath != null) && (obj.fs.existsSync(obj.path.join(obj.parent.webViewsOverridePath, 'translations')))) { + translateFolder = obj.path.join(obj.parent.webViewsOverridePath, 'translations'); var files = obj.fs.readdirSync(translateFolder); for (var i in files) { var name = files[i];