From be8b0e735821353bc0b7dce11c552e8db8d35c80 Mon Sep 17 00:00:00 2001 From: Fredrik Strand Oseberg Date: Mon, 8 Mar 2021 15:31:02 +0100 Subject: [PATCH] fix: check that strategies exists before calling includes (#252) --- .../src/component/strategies/strategy-details-container.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/frontend/src/component/strategies/strategy-details-container.js b/frontend/src/component/strategies/strategy-details-container.js index b93771c694..85a8626591 100644 --- a/frontend/src/component/strategies/strategy-details-container.js +++ b/frontend/src/component/strategies/strategy-details-container.js @@ -7,7 +7,11 @@ import { hasPermission } from '../../permissions'; const mapStateToProps = (state, props) => { let strategy = state.strategies.get('list').find(n => n.name === props.strategyName); - const applications = state.applications.get('list').filter(app => app.strategies.includes(props.strategyName)); + + const applications = state.applications + .get('list') + .filter(app => app.strategies && app.strategies.includes(props.strategyName)); + const toggles = state.features.filter( toggle => toggle.get('strategies').findIndex(s => s.name === props.strategyName) > -1 );