Skip to content

Commit 19c3bee

Browse files
author
Akarshit Wal
committed
(bugfix): check shop variable for null
Signed-off-by: Akarshit Wal <akarshit.wal@mailchimp.com>
1 parent 83341b6 commit 19c3bee

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

pages/[lang]/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ export async function getStaticProps({ params: { lang } }) {
9898
const primaryShop = await fetchPrimaryShop(lang);
9999
const translations = await fetchTranslations(lang, ["common"]);
100100

101-
if (!primaryShop) {
101+
if (!primaryShop?.shop) {
102102
return {
103103
props: {
104104
shop: null,

pages/[lang]/product/[...slugOrId].js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ export async function getStaticProps({ params: { slugOrId, lang } }) {
134134
const productSlug = slugOrId && slugOrId[0];
135135
const primaryShop = await fetchPrimaryShop(lang);
136136

137-
if (!primaryShop) {
137+
if (!primaryShop?.shop) {
138138
return {
139139
props: {
140140
shop: null,

pages/[lang]/tag/[slug].js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ class TagGridPage extends Component {
161161
export async function getStaticProps({ params: { lang, slug } }) {
162162
const primaryShop = await fetchPrimaryShop(lang);
163163

164-
if (!primaryShop) {
164+
if (!primaryShop?.shop) {
165165
return {
166166
props: {
167167
shop: null,

0 commit comments

Comments
 (0)