From: Matthias Schmidt Date: Sun, 31 Jul 2016 11:43:58 +0000 (+0200) Subject: Fix potential error in UiPageAction.remove() X-Git-Tag: 3.0.0_Beta_1~847 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=293e3724a2c1e21bb7d4bd8338b29acca7af6502;p=GitHub%2FWoltLab%2FWCF.git Fix potential error in UiPageAction.remove() --- diff --git a/wcfsetup/install/files/js/WoltLab/WCF/Ui/Page/Action.js b/wcfsetup/install/files/js/WoltLab/WCF/Ui/Page/Action.js index 8314cd7d3b..12be9fa6e4 100644 --- a/wcfsetup/install/files/js/WoltLab/WCF/Ui/Page/Action.js +++ b/wcfsetup/install/files/js/WoltLab/WCF/Ui/Page/Action.js @@ -107,10 +107,15 @@ define(['Dictionary', 'Dom/Util'], function(Dictionary, DomUtil) { if (button !== undefined) { var listItem = button.parentNode; listItem.addEventListener('animationend', function () { - _container.removeChild(listItem); - _buttons.delete(buttonName); + try { + _container.removeChild(listItem); + _buttons.delete(buttonName); + } + catch (e) { + // ignore errors if the element has already been removed + } }); - + this.hide(buttonName); } },