Avoid error if this.input is not yet set

This commit is contained in:
nathangray 2017-11-20 09:26:04 -07:00
parent 7e6bcc035f
commit 2364a39de0

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
}