diff --git a/apps/website/src/app/docAPI.ts b/apps/website/src/app/docAPI.ts index c010caf0b..ca476a85d 100644 --- a/apps/website/src/app/docAPI.ts +++ b/apps/website/src/app/docAPI.ts @@ -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 ?? {}; }