Fix 'undefined' in read only selectboxes when value was not in list of options

This commit is contained in:
Nathan Gray 2013-03-25 23:00:25 +00:00
parent fc0b2d1e8a
commit fbd81e6aa9

View File

@ -666,10 +666,15 @@ var et2_selectbox_ro = et2_selectbox.extend([et2_IDetachedDOM], {
for(var i = 0; i < _value.length; i++)
{
var option = this.optionValues[_value[i]];
if(typeof option === "object")
if(typeof option === "object" && option != null)
{
option = option.label;
}
else if (typeof option == 'undefined')
{
// Not a valid option
continue;
}
this.span.append("<li>"+option+"</li>");
}
}