diff --git a/src/main/setting-storage.ts b/src/main/setting-storage.ts index 7d926fc18..48c265e40 100644 --- a/src/main/setting-storage.ts +++ b/src/main/setting-storage.ts @@ -19,6 +19,11 @@ export const readSettings = (): ChainnerSettings => { // legacy settings const storagePath = path.join(getRootDirSync(), 'settings'); + if (!existsSync(storagePath)) { + // neither settings.json nor old settings exist, so this is a fresh install + return { ...defaultSettings }; + } + const storage = new LocalStorage(storagePath); const partialSettings = migrateOldStorageSettings({ keys: Array.from({ length: storage.length }, (_, i) => storage.key(i)),