diff --git a/src/components/image/SanityImage.tsx b/src/components/image/SanityImage.tsx index 7d87cff24..2a143e71c 100644 --- a/src/components/image/SanityImage.tsx +++ b/src/components/image/SanityImage.tsx @@ -29,8 +29,12 @@ const useNextSanityGlobalImage = ( useState(null); useEffect(() => { - fetch(studioImage.src).then((r) => r.ok && setGlobalImage(studioImage)); - fetch(sharedImage.src).then((r) => r.ok && setGlobalImage(sharedImage)); + if (studioImage) { + fetch(studioImage.src).then((r) => r.ok && setGlobalImage(studioImage)); + } + if (sharedImage) { + fetch(sharedImage.src).then((r) => r.ok && setGlobalImage(sharedImage)); + } }, [studioImage, sharedImage]); return globalImage;