From 84175aa4c1e97138f140083ff0fe29dfeecc9a33 Mon Sep 17 00:00:00 2001 From: "pablo.rey" Date: Tue, 24 Oct 2023 17:41:27 +0200 Subject: [PATCH] fix(packages/sui-ssr): safe check of type --- packages/sui-ssr/server/initialContextValue/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/sui-ssr/server/initialContextValue/index.js b/packages/sui-ssr/server/initialContextValue/index.js index 1f0bdfa71..2604094dc 100644 --- a/packages/sui-ssr/server/initialContextValue/index.js +++ b/packages/sui-ssr/server/initialContextValue/index.js @@ -15,7 +15,7 @@ export const INITIAL_CONTEXT_VALUE = '__INITIAL_CONTEXT_VALUE__' export const getInitialContextValue = context => Object.keys(context) .filter( - contextKey => typeof context[contextKey].getInitialData === 'function' + contextKey => typeof context[contextKey]?.getInitialData === 'function' ) .reduce((acc, contextKey) => { acc[contextKey] = context[contextKey].getInitialData()