Fix #1103: catch failed loadPrefs

This commit is contained in:
Oliver Blanthorn 2026-07-23 10:44:24 +02:00
parent ae2abcd412
commit c7281edab6
No known key found for this signature in database
GPG key ID: 2BB8C36BB504BFF3

View file

@ -771,8 +771,8 @@ export function parsePrefs(prefFileContent: string) {
* return a promise for an empty object.
*/
export async function loadPrefs(filename): Promise<{ [key: string]: string }> {
const result = await read(filename)
if (result.code !== 0) return {}
const result = await read(filename).catch(() => undefined)
if (result === undefined || result.code !== 0) return {}
return parsePrefs(result.content)
}