From 6bd03bac22815e830794afa0a95151e20b2f3277 Mon Sep 17 00:00:00 2001 From: "noa.santo" Date: Mon, 15 Jan 2024 15:02:18 +0100 Subject: [PATCH] fix: netlify build error fix --- src/templates/blog-post.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/templates/blog-post.tsx b/src/templates/blog-post.tsx index 5c2262cb2..2f2b809d1 100644 --- a/src/templates/blog-post.tsx +++ b/src/templates/blog-post.tsx @@ -46,7 +46,10 @@ export const Head = ({ const { author, seoMetaText, title, publicationDate, heroImage } = data.contentfulBlogPost; - const shareImagePath = heroImage.shareImage.resize.src; + let shareImagePath = ''; + if (heroImage && heroImage.shareImage && heroImage.shareImage.resize) { + shareImagePath = heroImage.shareImage.resize.src; + } /* * SEO Notes: