From 1ad0520df924e3e0b876c848b83b95ff7d27105d Mon Sep 17 00:00:00 2001 From: Jairo <68893868+jairo-bc@users.noreply.github.com> Date: Thu, 24 Feb 2022 12:00:14 -0500 Subject: [PATCH] fix: empty response from regions graphql (#878) --- lib/content-api-client.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/content-api-client.js b/lib/content-api-client.js index b2160013..73d1bf63 100644 --- a/lib/content-api-client.js +++ b/lib/content-api-client.js @@ -31,6 +31,9 @@ async function getRenderedRegionsByPageType({ accessToken, storeUrl, pageType }) }), }); + if (!response.data.data) { + return { renderedRegions: [] }; + } const { site: { content: { @@ -75,6 +78,9 @@ async function getRenderedRegionsByPageTypeAndEntityId({ }), }); + if (!response.data.data) { + return { renderedRegions: [] }; + } const { site: { content: {