Handle null image
All checks were successful
Build and Deploy to Web Server / deploy (push) Successful in 14m56s
All checks were successful
Build and Deploy to Web Server / deploy (push) Successful in 14m56s
This commit is contained in:
@@ -4,7 +4,7 @@ const { src, alt } = Astro.props;
|
||||
|
||||
import { getImageByPath } from "@lib/utils";
|
||||
|
||||
const imageSRC = getImageByPath(src)!;
|
||||
const image = getImageByPath(src);
|
||||
---
|
||||
|
||||
<Image src={imageSRC} alt={alt} />
|
||||
{image && <Image src={image} alt={alt} />}
|
||||
|
Reference in New Issue
Block a user