diff --git a/src/components/ui/Image.tsx b/src/components/ui/Image.tsx index cf8de4ec..aecec6c5 100644 --- a/src/components/ui/Image.tsx +++ b/src/components/ui/Image.tsx @@ -1,7 +1,6 @@ import React from "react" import { default as NextImage, ImageProps } from "next/image" import { toGateway, toIPFS } from "~/lib/ipfs-parser" -import { cn } from "~/lib/utils" export const Image: React.FC< { @@ -20,6 +19,12 @@ export const Image: React.FC< const autoSize = !width && !height && !fill const noOptimization = className?.includes("no-optimization") + try { + new URL(src) + } catch (error) { + return null + } + return noOptimization ? ( // eslint-disable-next-line @next/next/no-img-element