From 3254d40f75e42f91d16cd868d89cc17e7da8c58e Mon Sep 17 00:00:00 2001 From: Sam Becker Date: Tue, 5 Sep 2023 10:44:10 -0500 Subject: [PATCH] Handle missing photo OG response --- src/app/(isr)/photos/[photoId]/image/route.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/app/(isr)/photos/[photoId]/image/route.tsx b/src/app/(isr)/photos/[photoId]/image/route.tsx index 92d01739..45a8539a 100644 --- a/src/app/(isr)/photos/[photoId]/image/route.tsx +++ b/src/app/(isr)/photos/[photoId]/image/route.tsx @@ -10,7 +10,11 @@ export const runtime = 'edge'; export async function GET(request: Request, context: any) { const photo = await getPhoto(context.params.photoId); + + if (!photo) { return null; } + const fontData = await getIBMPlexMonoMedium(); + return new ImageResponse( (