diff --git a/src/image-response/components/ImagePhotoGrid.tsx b/src/image-response/components/ImagePhotoGrid.tsx index 0b8abd97..fa70c632 100644 --- a/src/image-response/components/ImagePhotoGrid.tsx +++ b/src/image-response/components/ImagePhotoGrid.tsx @@ -59,11 +59,21 @@ export default async function ImagePhotoGrid({ IS_PREVIEW, ); + if (count === 0 || photoUrls.length === 0) { + return null; + } + const renderPhoto = ( - { id, urlData }: typeof photoUrls[number], + photo: (typeof photoUrls)[number] | undefined, width: number, height: number, - ) => + ) => { + if (!photo) { + return null; + } + + const { id, urlData } = photo; + return (
- ; + + ); + }; return (