Commit e762fc7c authored by Tyf0x's avatar Tyf0x

** fix for #282: prevent crash when trying to select non-existant value **

Signed-off-by: 's avatarTyf0x <Tyf0x@users.noreply.github.com>
parent 7a5590de
......@@ -747,6 +747,11 @@
var $option = this.getOptionByValue(value);
var $checkbox = this.getInputByValue(value);
if($option === void(0) || $checkbox === void(0))
{
continue;
}
if (this.options.selectedClass) {
$checkbox.parents('li')
.addClass(this.options.selectedClass);
......@@ -786,6 +791,11 @@
var $option = this.getOptionByValue(value);
var $checkbox = this.getInputByValue(value);
if($option === void(0) || $checkbox === void(0))
{
continue;
}
if (this.options.selectedClass) {
$checkbox.parents('li')
.removeClass(this.options.selectedClass);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment