18 lines
629 B
Diff
18 lines
629 B
Diff
|
diff --git a/src/main/settings.ts b/src/main/settings.ts
|
||
|
index 6fad97f..dfc64e3 100644
|
||
|
--- a/src/main/settings.ts
|
||
|
+++ b/src/main/settings.ts
|
||
|
@@ -26,8 +26,10 @@ function loadSettings<T extends object = any>(file: string, name: string) {
|
||
|
|
||
|
const store = new SettingsStore(settings);
|
||
|
store.addGlobalChangeListener(o => {
|
||
|
- mkdirSync(dirname(file), { recursive: true });
|
||
|
- writeFileSync(file, JSON.stringify(o, null, 4));
|
||
|
+ try {
|
||
|
+ mkdirSync(dirname(file), { recursive: true });
|
||
|
+ writeFileSync(file, JSON.stringify(o, null, 4));
|
||
|
+ } catch {}
|
||
|
});
|
||
|
|
||
|
return store;
|