diff --git a/msgbox/msgbox.js b/msgbox/msgbox.js index 3cf7a5bf..2ad33870 100644 --- a/msgbox/msgbox.js +++ b/msgbox/msgbox.js @@ -145,8 +145,10 @@ function messageBox({ } function removeSelf() { - messageBox.element.remove(); - messageBox.element = null; + if (messageBox.element) { + messageBox.element.remove(); + messageBox.element = null; + } messageBox.resolve = null; } }