Skip to content

Commit

Permalink
fix(packages/sui-ssr): safe check of type
Browse files Browse the repository at this point in the history
  • Loading branch information
pablo.rey committed Oct 24, 2023
1 parent 4951407 commit 84175aa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/sui-ssr/server/initialContextValue/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 84175aa

Please sign in to comment.