1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-01-25 00:07:47 +01:00

fix: check that strategies exists before calling includes (#252)

This commit is contained in:
Fredrik Strand Oseberg 2021-03-08 15:31:02 +01:00 committed by GitHub
parent 95d83dc812
commit be8b0e7358

View File

@ -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
);