fix bug with sync and deleting instance

This commit is contained in:
Arthur Lu 2023-11-07 05:09:28 +00:00
parent 89f0b14c21
commit 4806d7f18f

View File

@ -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);