Handle null values without errors

This commit is contained in:
Nathan Gray 2012-05-02 22:12:42 +00:00
parent 7852cf2baa
commit d2fc62a474

View File

@ -554,15 +554,18 @@ var et2_selectbox_ro = et2_selectbox.extend([et2_IDetachedDOM], {
if(typeof _value == "object") if(typeof _value == "object")
{ {
this.span.empty(); this.span.empty();
for(var i = 0; i < _value.length; i++) if(_value)
{ {
var option = this.optionValues[_value[i]]; for(var i = 0; i < _value.length; i++)
if(typeof option === "object")
{ {
option = option.label; var option = this.optionValues[_value[i]];
if(typeof option === "object")
{
option = option.label;
}
this.span.append("<li>"+option+"</li>");
} }
this.span.append("<li>"+option+"</li>"); }
}
return; return;
} }
var option = this.optionValues[_value]; var option = this.optionValues[_value];