Skip to content

Commit

Permalink
fix(gatsby-theme-docz): check data before access
Browse files Browse the repository at this point in the history
  • Loading branch information
pedronauck committed Feb 27, 2019
1 parent d1e148f commit 8f8ed12
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/gatsby-theme-docz/src/node/createPages.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ module.exports = ({ graphql, actions }, opts) => {

return graphql(ENTRIES_QUERY).then(({ data, errors }) => {
const hasErrors = errors && errors.length > 0
const entries = data.allDoczEntries.edges
const entries = data && data.allDoczEntries.edges
if (!entries || entries.length === 0 || hasErrors) return

entries.forEach(({ node: entry }) => {
Expand Down

0 comments on commit 8f8ed12

Please sign in to comment.