Fixed potential infinite loop
authorAlexander Ebert <ebert@woltlab.com>
Thu, 8 Dec 2016 14:54:19 +0000 (15:54 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Thu, 8 Dec 2016 14:54:29 +0000 (15:54 +0100)
wcfsetup/install/files/js/WoltLabSuite/Core/Bbcode/Collapsible.js

index 3a86bf88da2fad47572c1a372e7dded3aa30c2df..a2e4994cfcf69039bcf04178806ed1ca1b5bffdd 100644 (file)
@@ -21,11 +21,7 @@ define([], function() {
                                container = _containers[0];
                                
                                toggleButton = elBySelAll('.toggleButton', container)[0];
-                               if (toggleButton === undefined) {
-                                       continue;
-                               }
-                               
-                               if (toggleButton.closest('.jsCollapsibleBbcode') === container) {
+                               if (toggleButton && toggleButton.closest('.jsCollapsibleBbcode') === container) {
                                        (function (container, toggleButton) {
                                                var toggle = function (event) {
                                                        if (container.classList.toggle('collapsed')) {