setting arrayofStacks to the last stack from the cloned array. If that is undefined as well then setting it to an empty array

This commit is contained in:
Amar Zavery 2017-04-10 21:03:59 -07:00
Родитель 81059bf032
Коммит 19fd429064
1 изменённых файлов: 1 добавлений и 1 удалений

Просмотреть файл

@ -614,7 +614,7 @@ function searchDiscriminator(searchObj, searchValue, swaggerSpec, parentObj, arr
let clonedStacks = _.cloneDeep(arrayofStacks);
for (let i = 0; i < arrayVal.length; i++) {
if (arrayofStacks[i] === null || arrayofStacks[i] === undefined) {
arrayofStacks[i] = clonedStacks[i - 1];
arrayofStacks[i] = clonedStacks.length ? clonedStacks[clonedStacks.length - 1] : [];
}
arrayofStacks[i].push(`${i}`);
}