diff --git a/source/Provider.tsx b/source/Provider.tsx index 6ced107ea..b69923eec 100644 --- a/source/Provider.tsx +++ b/source/Provider.tsx @@ -67,7 +67,7 @@ export default class Provider extends PureComponent { history: this.history, sitePaths: this.props.sitePaths }), - ...props.reduxMiddlewares + ...(props.reduxMiddlewares ?? []) ) ) if (this.props.language) { diff --git a/source/reducers/rootReducer.ts b/source/reducers/rootReducer.ts index c746063ae..e48a7cd3a 100644 --- a/source/reducers/rootReducer.ts +++ b/source/reducers/rootReducer.ts @@ -282,7 +282,7 @@ const mainReducer = (state, action: Action) => a, b, a && analysisWithDefaultsSelector(state), - state.inFranceApp?.existingCompany + state?.inFranceApp?.existingCompany ), previousSimulation: defaultTo(null) as Reducer, currentExample,