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,6 +554,8 @@ var et2_selectbox_ro = et2_selectbox.extend([et2_IDetachedDOM], {
if(typeof _value == "object") if(typeof _value == "object")
{ {
this.span.empty(); this.span.empty();
if(_value)
{
for(var i = 0; i < _value.length; i++) for(var i = 0; i < _value.length; i++)
{ {
var option = this.optionValues[_value[i]]; var option = this.optionValues[_value[i]];
@ -563,6 +565,7 @@ var et2_selectbox_ro = et2_selectbox.extend([et2_IDetachedDOM], {
} }
this.span.append("<li>"+option+"</li>"); this.span.append("<li>"+option+"</li>");
} }
}
return; return;
} }
var option = this.optionValues[_value]; var option = this.optionValues[_value];