From 37142c2db04114c13aa0f8288146f83595cbbd1c Mon Sep 17 00:00:00 2001 From: Fen Dweller Date: Sat, 30 May 2020 19:11:40 -0400 Subject: [PATCH] Fix an error when deleting a dragged entity The viewer would try to call updateEntityElement, but the entity would be deleted, causing an error. --- macrovision.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/macrovision.js b/macrovision.js index b25ede9e..58071b05 100644 --- a/macrovision.js +++ b/macrovision.js @@ -1167,6 +1167,9 @@ function removeEntity(element) { if (selected == element) { deselect(); } + if (clicked == element) { + clicked = null; + } const option = document.querySelector("#options-selected-entity-" + element.dataset.key); option.parentElement.removeChild(option);