1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-12-22 19:07:54 +01:00

avoid exception if missing strategy

This commit is contained in:
sveisvei 2016-10-24 18:24:32 +02:00 committed by Ivar Conradi Østhus
parent 230522cc17
commit c4adff4a2d

View File

@ -6,8 +6,10 @@ function addOldFields (feature) {
modifiedFeature.strategies = [];
return modifiedFeature;
}
modifiedFeature.strategy = feature.strategies[0].name;
modifiedFeature.parameters = Object.assign({}, feature.strategies[0].parameters);
if (feature.strategies[0]) {
modifiedFeature.strategy = feature.strategies[0].name;
modifiedFeature.parameters = Object.assign({}, feature.strategies[0].parameters);
}
return modifiedFeature;
}