diff --git a/app/base_config.js b/app/base_config.js index 31f752cf2..be6096ec3 100644 --- a/app/base_config.js +++ b/app/base_config.js @@ -8,7 +8,8 @@ module.exports = { start, }; -function start(name, targetPath) { +function start(name, targetPath, options = {}) { + const { allowMalformedOnStartup } = options; let cachedValue = null; try { @@ -23,7 +24,7 @@ function start(name, targetPath) { cachedValue = Object.create(null); } } catch (error) { - if (error.code !== 'ENOENT') { + if (!allowMalformedOnStartup && error.code !== 'ENOENT') { throw error; } diff --git a/app/ephemeral_config.js b/app/ephemeral_config.js index b2b91cb5a..84b498743 100644 --- a/app/ephemeral_config.js +++ b/app/ephemeral_config.js @@ -7,6 +7,8 @@ const { start } = require('./base_config'); const userDataPath = app.getPath('userData'); const targetPath = path.join(userDataPath, 'ephemeral.json'); -const ephemeralConfig = start('ephemeral', targetPath); +const ephemeralConfig = start('ephemeral', targetPath, { + allowMalformedOnStartup: true, +}); module.exports = ephemeralConfig;