Skip to content

Commit

Permalink
fix(gatsby-source-wordpress): add a check for namespaces in response …
Browse files Browse the repository at this point in the history
…from wp (#10891)
  • Loading branch information
sidharthachatterjee authored and pieh committed Jan 8, 2019
1 parent 45ec012 commit d96016c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/gatsby-source-wordpress/src/fetch.js
Expand Up @@ -445,9 +445,9 @@ function getValidRoutes({
if (_useACF) {
let defaultAcfNamespace = `acf/v3`
// Grab ACF Version from namespaces
const acfNamespace = allRoutes.data.namespaces.find(namespace =>
namespace.includes(`acf`)
)
const acfNamespace = allRoutes.data.namespaces
? allRoutes.data.namespaces.find(namespace => namespace.includes(`acf`))
: null
const acfRestNamespace = acfNamespace ? acfNamespace : defaultAcfNamespace
_includedRoutes.push(`/${acfRestNamespace}/**`)

Expand Down

0 comments on commit d96016c

Please sign in to comment.