Skip to content

Commit

Permalink
Update gatsby-node.js (#9211)
Browse files Browse the repository at this point in the history
Deleting directory make gatsby crash. When working with markdownfiles and deleting a directory the developer server will crash. The same check that is for files should also be on directories, otherwise it might try to delete a directory that does not exist.
  • Loading branch information
goofytroopy authored and m-allanson committed Oct 18, 2018
1 parent b05bed5 commit 35eacd7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/gatsby-source-filesystem/src/gatsby-node.js
Expand Up @@ -177,7 +177,9 @@ See docs here - https://www.gatsbyjs.org/packages/gatsby-source-filesystem/
reporter.info(`directory deleted at ${path}`)
}
const node = getNode(createNodeId(path))
deleteNode({ node })
if (node) {
deleteNode({ node })
}
})

return new Promise((resolve, reject) => {
Expand Down

0 comments on commit 35eacd7

Please sign in to comment.