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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user