From 46773d290d8790d607105f070c183ffbd5cbec49 Mon Sep 17 00:00:00 2001 From: Arthur Lu Date: Tue, 7 Nov 2023 05:09:28 +0000 Subject: [PATCH] fix bug with sync and deleting instance --- scripts/instance.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/instance.js b/scripts/instance.js index 0d55eca..34981c4 100644 --- a/scripts/instance.js +++ b/scripts/instance.js @@ -233,7 +233,9 @@ class InstanceCard extends HTMLElement { const result = await requestAPI(`/cluster/${this.node.name}/${this.type}/${this.vmid}/delete`, "DELETE"); if (result.status === 200) { - this.parentElement.removeChild(this); + if (this.parentElement) { + this.parentElement.removeChild(this); + } } else { alert(result.error);