From c8d6759e96c6005a8b9bd8941a4ff7725fdef705 Mon Sep 17 00:00:00 2001 From: Kota Iguchi Date: Fri, 30 Aug 2019 08:32:13 +0900 Subject: [PATCH] fix: crash when localeStrings is not found --- lib/platform/require.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/platform/require.js b/lib/platform/require.js index 99aa5ab..a04363b 100644 --- a/lib/platform/require.js +++ b/lib/platform/require.js @@ -88,7 +88,11 @@ Module.patch = function (globalCtx, url, port) { // ignore } - globalCtx.localeStrings = Module.require('localeStrings'); + try { + globalCtx.localeStrings = Module.require('localeStrings'); + } catch (e) { + globalCtx.localeStrings = []; + } Module.connectServer(); }; @@ -120,8 +124,9 @@ Module.connectServer = function () { }); client.on('connect', function () { - if (retryInterval) { + if (retryInterval !== null) { clearInterval(retryInterval); + retryInterval = null; console.log('[LiveView]', 'Reconnected to Event Server'); } });