From 21bcb0fb31c7723ac1599cf5b9ec5387490959b8 Mon Sep 17 00:00:00 2001 From: Mike Surowiec Date: Wed, 19 May 2021 08:33:41 -0700 Subject: [PATCH] fix: cookies may not be there --- components/lib/getThemeProps.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/lib/getThemeProps.tsx b/components/lib/getThemeProps.tsx index 2c9792e8c7..56fd96a450 100644 --- a/components/lib/getThemeProps.tsx +++ b/components/lib/getThemeProps.tsx @@ -23,7 +23,7 @@ export const getThemeProps = (req: any, mode?: 'css') => { } = {} const defaultProps = mode === 'css' ? defaultCSSThemeProps : defaultThemeProps - if (req.cookies.color_mode) { + if (req.cookies?.color_mode) { try { cookieValue = JSON.parse(decodeURIComponent(req.cookies.color_mode)) } catch {