Skip to content

Commit

Permalink
fix null checks
Browse files Browse the repository at this point in the history
Signed-off-by: Shivam Gupta <[email protected]>
  • Loading branch information
ShivamCoder23 committed Dec 28, 2024
1 parent 1627365 commit fb806e9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/templates/blog-single.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ export const query = graphql`query BlogsBySlug($slug: String!) {

const BlogSinglePage = ({ data }) => {

if (!data?.mdx) {
return null;
}

return (

Expand All @@ -63,5 +66,5 @@ export default BlogSinglePage;


export const Head = ({ data }) => {
return <SEO title={data.mdx.frontmatter.title} image={data.mdx.frontmatter.thumbnail.publicURL} description={data.mdx.frontmatter.description} />;
return <SEO title={data?.mdx?.frontmatter?.title} image={data?.mdx?.frontmatter?.thumbnail?.publicURL} description={data.mdx.frontmatter.description} />;
};

0 comments on commit fb806e9

Please sign in to comment.