gatsby-remark-relative-images icon indicating copy to clipboard operation
gatsby-remark-relative-images copied to clipboard

Ensure absolute path exists

Open chawes13 opened this issue 2 years ago • 0 comments

Resolves #38

Contentful allows for a field type of "Long Text". This is created as a MarkdownRemark node. This node does not have a fileAbsolutePath set (i.e., is null). Invoking path.dirname without a value throws the error shown in #38.

It appears as though the author was aware of nodes without this value populated existing, given the guard implemented here: https://github.com/danielmahon/gatsby-remark-relative-images/blob/3da59696cd3e0f8eb01f0376004a95d011d1f2e3/src/index.ts#L81-L83

This PR adds the same guard to the onCreateNode definition

chawes13 avatar Apr 13 '22 18:04 chawes13