From 5e4223e07b73baaff44989f117ee9fcade45d671 Mon Sep 17 00:00:00 2001 From: thediveo Date: Thu, 1 Feb 2024 14:35:53 +0100 Subject: [PATCH] fix: crash in UI when VXLAN underlay is unknown, fixes #39 Signed-off-by: thediveo --- webui/src/models/gw/model.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/webui/src/models/gw/model.ts b/webui/src/models/gw/model.ts index 5019193..07fe9f5 100644 --- a/webui/src/models/gw/model.ts +++ b/webui/src/models/gw/model.ts @@ -286,10 +286,12 @@ export const fromjson = (jsondata: JSONObject) => { // this VXLAN is the overlay, resolve our underlay reference, // and then backlink the underlay to us (the overlay). nif.underlay = nifmap[(jnif.vxlan as JSONObject).idref as string] - if (!nif.underlay.overlays) { - nif.underlay.overlays = [] + if (nif.underlay) { + if (!nif.underlay.overlays) { + nif.underlay.overlays = [] + } + nif.underlay.overlays.push(nif) } - nif.underlay.overlays.push(nif) } // TAP/TUNs don't reference other network interfaces, but processes // ... but hey. we need to resolve this relation, too!