mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
fix: handle errors gracefully
This commit is contained in:
@@ -45,7 +45,7 @@ export async function fetchModelJSON(packageName: string, version: string): Prom
|
||||
]);
|
||||
|
||||
// @ts-expect-error: https://github.com/planetscale/database-js/issues/71
|
||||
return rows[0].data;
|
||||
return rows[0]?.data ?? {};
|
||||
}
|
||||
|
||||
const { rows } = await sql.execute('select data from documentation where name = ? and version = ?', [
|
||||
@@ -54,5 +54,5 @@ export async function fetchModelJSON(packageName: string, version: string): Prom
|
||||
]);
|
||||
|
||||
// @ts-expect-error: https://github.com/planetscale/database-js/issues/71
|
||||
return rows[0].data;
|
||||
return rows[0]?.data ?? {};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user