From d3a6df82aaf00212639e8f0911d9d5db369e192c Mon Sep 17 00:00:00 2001 From: "noa.santo" Date: Mon, 15 Jan 2024 14:41:39 +0100 Subject: [PATCH] fix: netlify build error fix --- src/templates/blog-post.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/templates/blog-post.tsx b/src/templates/blog-post.tsx index 5c2262cb2..ef1a8f2be 100644 --- a/src/templates/blog-post.tsx +++ b/src/templates/blog-post.tsx @@ -46,8 +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: * Recommended meta description length these days is 120 - 158 characters. The lower number is relevant for mobile devices.