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

add array check before iterating

This commit is contained in:
sveisvei 2017-01-09 12:39:32 +01:00
parent d0316392f6
commit 314f73448a
2 changed files with 11 additions and 6 deletions

View File

@ -20,9 +20,12 @@ const prepare = (methods, dispatch) => {
(e) => {
e.preventDefault();
input.strategies.forEach((s) => {
delete s.id;
});
if (Array.isArray(input.strategies)) {
input.strategies.forEach((s) => {
delete s.id;
});
}
createFeatureToggles(input)(dispatch)
.then(() => methods.clear())

View File

@ -30,9 +30,11 @@ const prepare = (methods, dispatch) => {
(e) => {
e.preventDefault();
input.strategies.forEach((s) => {
delete s.id;
});
if (Array.isArray(input.strategies)) {
input.strategies.forEach((s) => {
delete s.id;
});
}
// TODO: should add error handling
requestUpdateFeatureToggle(input)(dispatch)
.then(() => methods.clear())