From e7132a127f5a76e2ced598ad1702764ef0243ac7 Mon Sep 17 00:00:00 2001 From: Ray Greenwell Date: Sat, 17 Jan 2009 03:17:57 +0000 Subject: [PATCH] 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 --- src/as/com/threerings/flex/CommandComboBox.as | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/as/com/threerings/flex/CommandComboBox.as b/src/as/com/threerings/flex/CommandComboBox.as index 9463ebf2..15c46d58 100644 --- a/src/as/com/threerings/flex/CommandComboBox.as +++ b/src/as/com/threerings/flex/CommandComboBox.as @@ -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