From 6a3ae01fb6c25e7353be50dc96f3c93eaa660aa4 Mon Sep 17 00:00:00 2001 From: Ryan Hefner Date: Wed, 22 Jan 2020 16:48:22 -0500 Subject: [PATCH] Fix Contentful schema validation for null nodes for fixed/fluid media assets (#20794) --- packages/gatsby-source-contentful/src/extend-node-type.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/gatsby-source-contentful/src/extend-node-type.js b/packages/gatsby-source-contentful/src/extend-node-type.js index a2c15923a676a..3c50e99d15306 100644 --- a/packages/gatsby-source-contentful/src/extend-node-type.js +++ b/packages/gatsby-source-contentful/src/extend-node-type.js @@ -397,6 +397,8 @@ const fixedNodeType = ({ name, getTracedSVG }) => { }, resolve: (image, options, context) => Promise.resolve(resolveFixed(image, options)).then(node => { + if (!node) return null + return { ...node, image, @@ -494,6 +496,8 @@ const fluidNodeType = ({ name, getTracedSVG }) => { }, resolve: (image, options, context) => Promise.resolve(resolveFluid(image, options)).then(node => { + if (!node) return null + return { ...node, image,