Fix for when the items don't have a 'data' property.

git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@756 ed5b42cb-e716-0410-a449-f6a68f950b19
This commit is contained in:
Ray Greenwell
2009-01-17 03:17:57 +00:00
parent d22fcc041b
commit e7132a127f
@@ -102,7 +102,14 @@ public class CommandComboBox extends ComboBox
*/
protected function itemToData (item :Object) :Object
{
return (item == null || dataField == null) ? item : item[dataField];
if (item != null && dataField != null) {
try {
return item[dataField];
} catch (re :ReferenceError) {
// fallback to just returning the item
}
}
return item;
}
protected function handleChange (event :ListEvent) :void