From: Alexander Ebert Date: Mon, 23 Dec 2013 11:44:27 +0000 (+0100) Subject: Fix for assigned but no longer associated label groups X-Git-Tag: 2.0.1~19^2~3 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=f3511a160de8447746e04631ede6ceb6f70e58c2;p=GitHub%2FWoltLab%2FWCF.git Fix for assigned but no longer associated label groups --- 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)); + } } }