Skip to content

Commit

Permalink
fix(gatsby-theme-docz): throws false for json stringify
Browse files Browse the repository at this point in the history
  • Loading branch information
pedronauck committed Mar 15, 2019
1 parent 958e4c2 commit 289ca75
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions core/gatsby-theme-docz/src/node/sourceNodes.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ module.exports = async ({ actions, createNodeId }, opts) => {
}

const createDbNode = async () => {
const db = await fs.readJSON(config.paths.db)
const contentDigest = digest(JSON.stringify(db))
const db = await fs.readJSON(config.paths.db, { throws: false })
const contentDigest = digest(JSON.stringify(db || {}))

createNode({
id: createNodeId('docz-db'),
db: JSON.stringify(db),
db: JSON.stringify(db || {}),
children: [],
internal: {
contentDigest,
Expand Down

0 comments on commit 289ca75

Please sign in to comment.