pi sills
This commit is contained in:
@@ -14,8 +14,11 @@ dockRouter.get('/', async (ctx) => {
|
||||
const file = Bun.file(filePath);
|
||||
|
||||
if (await file.exists()) {
|
||||
const data = await file.json();
|
||||
return ctx.json(data);
|
||||
try {
|
||||
return ctx.json(await file.json());
|
||||
} catch {
|
||||
// corrupted file — treat as missing
|
||||
}
|
||||
}
|
||||
|
||||
return ctx.json(null);
|
||||
|
||||
Reference in New Issue
Block a user