From c68bfbd8fb0414b4065d5eb18b79f998543c3e79 Mon Sep 17 00:00:00 2001 From: Daniel Lando Date: Thu, 7 Jan 2021 10:40:35 +0100 Subject: [PATCH] fix: ensure target node exist when creating links --- src/components/Mesh.vue | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/components/Mesh.vue b/src/components/Mesh.vue index 2b9f386b2ea..f7f420c9605 100644 --- a/src/components/Mesh.vue +++ b/src/components/Mesh.vue @@ -235,14 +235,17 @@ export default { updateLinks () { this.links = [] - for (const source of this.nodes) { + for (const source of this.activeNodes) { if (source.neighbors) { for (const target of source.neighbors) { - this.links.push({ - sid: source.id, - tid: target, - _color: this.$vuetify.theme.dark ? 'white' : 'black' - }) + // ensure target node exists + if (this.nodes[target] && this.nodes[target].status !== 'Removed') { + this.links.push({ + sid: source.id, + tid: target, + _color: this.$vuetify.theme.dark ? 'white' : 'black' + }) + } } } }