Skip to content

Commit a936930

Browse files
philibeagregberge
authored andcommitted
fix(graphql): Cannot read property '0' of undefined (#45)
1 parent 2fcd434 commit a936930

File tree

1 file changed

+2
-2
lines changed
  • packages/smooth-backend-wordpress/src/acf

1 file changed

+2
-2
lines changed

packages/smooth-backend-wordpress/src/acf/api.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ export function createClient({
5858
},
5959

6060
async getContent(request) {
61-
const { data } = await this.getContents(request)
62-
return data[0] || null
61+
const { data = []} = await this.getContents(request)
62+
return data && data[0] || null
6363
},
6464

6565
async getContentPreview({ lang, id }) {

0 commit comments

Comments
 (0)