Avoid error if this.input is not yet set

This commit is contained in:
nathangray 2017-11-20 09:26:04 -07:00 committed by Hadi Nategh
parent 7e65dcbdae
commit f43ddba7bc

View File

@ -872,7 +872,7 @@ var et2_selectbox = (function(){ "use strict"; return et2_inputWidget.extend(
this.input.trigger("liszt:updated");
}
// Sometimes value gets set before options
if(this.value || this.options.empty_label || this.value === '' && this.input.children('[value=""]').length === 1)
if(this.value || this.options.empty_label || this.value === '' && this.input && this.input.children('[value=""]').length === 1)
{
this.set_value(this.value, true); // true = dont try to set_options, to avoid an infinit recursion
}