mirror of
https://github.com/tridactyl/tridactyl.git
synced 2026-09-10 07:16:33 -04:00
Fix #1103: catch failed loadPrefs
This commit is contained in:
parent
ae2abcd412
commit
c7281edab6
|
|
@ -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)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue