From da0f59bc9aa46348ca19448690339ecea93ca1c9 Mon Sep 17 00:00:00 2001 From: Bryan Roe Date: Wed, 12 Jan 2022 23:47:39 -0800 Subject: [PATCH] Added try/catch on util-language just in case --- agents/meshcore.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/agents/meshcore.js b/agents/meshcore.js index 9addfa09..6282094e 100644 --- a/agents/meshcore.js +++ b/agents/meshcore.js @@ -96,12 +96,17 @@ function setDefaultCoreTranslation(obj, field, value) function getCoreTranslation() { var ret = {}; - var lang = require('util-language').current; if (global.coretranslations != null) { - if (coretranslations[lang] == null) { lang = lang.split('-')[0]; } - if (coretranslations[lang] == null) { lang = 'en'; } - if (coretranslations[lang] != null) { ret = coretranslations[lang]; } + try + { + var lang = require('util-language').current; + if (coretranslations[lang] == null) { lang = lang.split('-')[0]; } + if (coretranslations[lang] == null) { lang = 'en'; } + if (coretranslations[lang] != null) { ret = coretranslations[lang]; } + } + catch (x) + { } } setDefaultCoreTranslation(ret, 'allow', 'Allow');