From eec8cbf31aca68c7c04b7f5775e25dbde4d22e8e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Joshua=20R=C3=BCsweg?= Date: Tue, 5 Jun 2018 15:30:55 +0200 Subject: [PATCH] Fix selecting elements with invalid summaryListSelector See #2508 --- .../js/WoltLabSuite/Core/Ui/Reaction/CountButtons.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Reaction/CountButtons.js b/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Reaction/CountButtons.js index 4bb40fb170..18d60674e9 100644 --- a/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Reaction/CountButtons.js +++ b/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Reaction/CountButtons.js @@ -168,9 +168,11 @@ define( _initReactionCountButtons: function(element, elementData) { var summaryList = elBySel(this._options.summaryListSelector, element); - var elements = elBySelAll('li', summaryList); - for (var i = 0, length = elements.length; i < length; i++) { - this._initReactionCountButton(elements[i], elementData.objectId); + if (summaryList !== null) { + var elements = elBySelAll('li', summaryList); + for (var i = 0, length = elements.length; i < length; i++) { + this._initReactionCountButton(elements[i], elementData.objectId); + } } }, -- 2.20.1