Fix potential error in UiPageAction.remove()
authorMatthias Schmidt <gravatronics@live.com>
Sun, 31 Jul 2016 11:43:58 +0000 (13:43 +0200)
committerMatthias Schmidt <gravatronics@live.com>
Sun, 31 Jul 2016 11:44:15 +0000 (13:44 +0200)
wcfsetup/install/files/js/WoltLab/WCF/Ui/Page/Action.js

index 8314cd7d3be18062f5d4a79a23cc72cc9cd7df58..12be9fa6e4e612dd0547cd1ad6886c3c5ee90103 100644 (file)
@@ -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);
                        }
                },