Skip to content

Commit

Permalink
Merge pull request #750 from pulsar-edit/dont-crash-on-invalid-config
Browse files Browse the repository at this point in the history
[core] Handle invalid config on load
  • Loading branch information
confused-Techie authored Oct 10, 2023
2 parents 00f19c9 + 87ab979 commit add45c1
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/main-process/start.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,14 @@ function getConfig() {
let configFilePath = getConfigFilePath();

if (configFilePath) {
const configFileData = CSON.readFileSync(configFilePath);
config.resetUserSettings(configFileData);
CSON.readFile(configFilePath, (error, data) => {
// Duplicated from `./src/config-file.js`.reload()
if (error) {
console.log(error.message);
} else {
config.resetUserSettings(data);
}
});
}

return config;
Expand Down

0 comments on commit add45c1

Please sign in to comment.