harden code: failure while reading a comment could stop the file list
Massimo Melina committed
May 9, 2026 at 10:43 UTC
40b12f0498bac2875b754f69c5a6224b14e71e94
1 file changed
+1
-1
src/fileAttr.ts
+1
-1
@@ -39,7 +39,7 @@ export async function storeFileAttr(path: string, k: string, v: any) {
39
export async function loadFileAttr(path: string, k: string) {
40
return await fsx?.get(path, FILE_ATTR_PREFIX + k)
41
.then((x: any) => x === '' ? undefined : tryJson(String(x)),
42
- () => fileAttrDb.isOpen() ? fileAttrDb.get(fileAttrKey(path, k)) : null)
42
+ () => fileAttrDb.isOpen() ? fileAttrDb.get(fileAttrKey(path, k)).catch(console.error) : null)
43
?? undefined // normalize, as we get null instead of undefined on windows
44
}
45