diff --git a/src/views/Settings.tsx b/src/views/Settings.tsx index 7210b11f..c8dd1f83 100644 --- a/src/views/Settings.tsx +++ b/src/views/Settings.tsx @@ -305,17 +305,20 @@ export const Settings = () => { const createSingleArrayForPolicy: any = []; policies.map((aControl: any) => { const cSingleAccessArray = aControl.allGroups ? aControl.allGroups : []; - aControl.rules[0].destinations.forEach((destination: any) => { - if (cSingleAccessArray.indexOf(destination.id) === -1) { - cSingleAccessArray.push(destination.id); - } - }); - - aControl.rules[0].sources.forEach((source: any) => { - if (cSingleAccessArray.indexOf(source.id) === -1) { - cSingleAccessArray.push(source.id); - } - }); + if (aControl.rules[0].destinations) { + aControl.rules[0].destinations.forEach((destination: any) => { + if (cSingleAccessArray.indexOf(destination.id) === -1) { + cSingleAccessArray.push(destination.id); + } + }); + } + if (aControl.rules[0].sources) { + aControl.rules[0].sources.forEach((source: any) => { + if (cSingleAccessArray.indexOf(source.id) === -1) { + cSingleAccessArray.push(source.id); + } + }); + } aControl["cSingleAccessArray"] = cSingleAccessArray; createSingleArrayForPolicy.push(aControl);