Skip to content

Commit

Permalink
null check
Browse files Browse the repository at this point in the history
  • Loading branch information
Robiquet committed Mar 21, 2024
1 parent 6901694 commit 65b34e2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pages/api/og/generate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ export default async function GenerateOgImage(request: NextRequest) {
}: MarketImageData = await fetch(marketUrl.href).then((r) => r.json());

const cmsRes = await fetch(cmsUrl).then((r) => r.json());
const cmsImageUrl = cmsRes[0]?.imageUrl;
const cmsQuestion = cmsRes[0]?.question;
const cmsImageUrl = cmsRes?.[0]?.imageUrl;
const cmsQuestion = cmsRes?.[0]?.question;

const fallbackImagePath = `${urlBase}${getFallbackImage(
market.tags,
Expand Down

0 comments on commit 65b34e2

Please sign in to comment.