From 462e90a97f760e75fae43b27ac4f5452045d9441 Mon Sep 17 00:00:00 2001 From: Michael Quigley Date: Thu, 4 Aug 2022 11:07:57 -0400 Subject: [PATCH] when no services --- ui/src/Network.js | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/ui/src/Network.js b/ui/src/Network.js index 795ab503..bd740572 100644 --- a/ui/src/Network.js +++ b/ui/src/Network.js @@ -46,21 +46,23 @@ function buildGraph(overview) { draggable: true }); id++ - item.services.forEach((item) => { - out.nodes.push({ - id: '' + id, - data: {label: 'Service: ' + item.zitiServiceId}, - position: {x: (id * 25), y: 0}, - draggable: true - }) - out.edges.push({ - id: 'e' + envId + '-' + id, - source: '' + id, - target: '' + envId, - animated: true - }) - id++ - }); + if(item.services != null) { + item.services.forEach((item) => { + out.nodes.push({ + id: '' + id, + data: {label: 'Service: ' + item.zitiServiceId}, + position: {x: (id * 25), y: 0}, + draggable: true + }) + out.edges.push({ + id: 'e' + envId + '-' + id, + source: '' + id, + target: '' + envId, + animated: true + }) + id++ + }); + } }); return out }