Skip to content

Commit

Permalink
check markdown images, ensure parent is File before referencing dir
Browse files Browse the repository at this point in the history
  • Loading branch information
calcsam committed Feb 2, 2018
1 parent 17b7912 commit 802dac0
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/gatsby-remark-copy-linked-files/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,11 @@ module.exports = (
return
}

// since dir will be undefined on non-files
if (getNode(markdownNode.parent).internal.type !== `File`) {
return
}

const imagePath = path.posix.join(
getNode(markdownNode.parent).dir,
image.url
Expand Down

0 comments on commit 802dac0

Please sign in to comment.