From b410581538c2568fc9c3d09248521a0471e9b96b Mon Sep 17 00:00:00 2001 From: Dirk Baeumer Date: Wed, 16 Jan 2019 11:44:28 +0100 Subject: [PATCH] Fixes #66548: Avoid double async-calls --- src/main.js | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/src/main.js b/src/main.js index 6b2bfae32c6..7429fcc087a 100644 --- a/src/main.js +++ b/src/main.js @@ -434,20 +434,16 @@ function getUserDefinedLocale() { } const localeConfig = path.join(userDataPath, 'User', 'locale.json'); - return exists(localeConfig).then((result) => { - if (result) { - return bootstrap.readFile(localeConfig).then((content) => { - content = stripComments(content); - try { - const value = JSON.parse(content).locale; - return value && typeof value === 'string' ? value.toLowerCase() : undefined; - } catch (e) { - return undefined; - } - }); - } else { + return bootstrap.readFile(localeConfig).then((content) => { + content = stripComments(content); + try { + const value = JSON.parse(content).locale; + return value && typeof value === 'string' ? value.toLowerCase() : undefined; + } catch (e) { return undefined; } + }, () => { + return undefined; }); } -- GitLab