Skip to content

Commit

Permalink
fix: better cache handling
Browse files Browse the repository at this point in the history
  • Loading branch information
Jnig committed Oct 4, 2024
1 parent bf56182 commit e5540f8
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,12 @@ export async function readCache(sessionName) {
} catch (_) {
return {};
}
return JSON.parse(await readFile(cacheFile, "utf8"));

try {
JSON.parse(await readFile(cacheFile, "utf8"));
} catch (_) {
return {};
}
}

export async function readAccountCache(sessionName) {
Expand Down

0 comments on commit e5540f8

Please sign in to comment.