From f9c035082f315c17a874d538d737232f0bdf471a Mon Sep 17 00:00:00 2001 From: Rob Garrison Date: Fri, 25 Aug 2017 15:50:05 -0500 Subject: [PATCH] Prevent JS error after closing help-popup --- msgbox/msgbox.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/msgbox/msgbox.js b/msgbox/msgbox.js index 4e418832..f545e26a 100644 --- a/msgbox/msgbox.js +++ b/msgbox/msgbox.js @@ -43,10 +43,12 @@ function messageBox({ } function resolveWith(value) { - unbindGlobalListeners(); - setTimeout(messageBox.resolve, 0, value); - animateElement(messageBox.element, {className: 'fadeout', remove: true}) - .then(removeSelf); + if (messageBox.resolve) { + unbindGlobalListeners(); + setTimeout(messageBox.resolve, 0, value); + animateElement(messageBox.element, {className: 'fadeout', remove: true}) + .then(removeSelf); + } } function createElement() {