From f3511a160de8447746e04631ede6ceb6f70e58c2 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Mon, 23 Dec 2013 12:44:27 +0100 Subject: [PATCH] Fix for assigned but no longer associated label groups --- wcfsetup/install/files/js/WCF.Label.js | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/wcfsetup/install/files/js/WCF.Label.js b/wcfsetup/install/files/js/WCF.Label.js index 48a03aebab..cfde218ce5 100644 --- a/wcfsetup/install/files/js/WCF.Label.js +++ b/wcfsetup/install/files/js/WCF.Label.js @@ -139,13 +139,16 @@ WCF.Label.Chooser = Class.extend({ // pre-select labels if ($.getLength(selectedLabelIDs)) { for (var $groupID in selectedLabelIDs) { - WCF.Dropdown.getDropdownMenu(this._groups[$groupID].wcfIdentify()).find('> ul > li:not(.dropdownDivider)').each($.proxy(function(index, label) { - var $label = $(label); - var $labelID = $label.data('labelID') || 0; - if ($labelID && selectedLabelIDs[$groupID] == $labelID) { - this._selectLabel($label, true); - } - }, this)); + var $group = this._groups[$groupID]; + if ($group) { + WCF.Dropdown.getDropdownMenu($group.wcfIdentify()).find('> ul > li:not(.dropdownDivider)').each($.proxy(function(index, label) { + var $label = $(label); + var $labelID = $label.data('labelID') || 0; + if ($labelID && selectedLabelIDs[$groupID] == $labelID) { + this._selectLabel($label, true); + } + }, this)); + } } } -- 2.20.1