Skip to content

Commit

Permalink
Return from onCreateNode() early if no url
Browse files Browse the repository at this point in the history
  • Loading branch information
harrygreen committed May 9, 2019
1 parent 29af414 commit 8de0757
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/gatsby-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,15 @@ exports.onCreateNode = async (

let fileNode
if (node.internal.type === nodeType) {

const url = ext ? `${get(node, imagePath)}${ext}` : get(node, imagePath)
if (!url) {
return
}

try {
fileNode = await createRemoteFileNode({
url: ext ? `${get(node, imagePath)}${ext}` : get(node, imagePath),
url,
parentNodeId: node.id,
store,
cache,
Expand Down

0 comments on commit 8de0757

Please sign in to comment.