If bead value is not found, prevent set states from blowing up.
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/425d9613 Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/425d9613 Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/425d9613 Branch: refs/heads/develop Commit: 425d9613964db13b09d6d80ee1a8d332cf0dcb2c Parents: 74c50e4 Author: Om <[email protected]> Authored: Thu Nov 7 11:16:59 2013 -0800 Committer: Om <[email protected]> Committed: Thu Nov 7 11:34:41 2013 -0800 ---------------------------------------------------------------------- frameworks/as/src/org/apache/flex/core/ViewBase.as | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/425d9613/frameworks/as/src/org/apache/flex/core/ViewBase.as ---------------------------------------------------------------------- diff --git a/frameworks/as/src/org/apache/flex/core/ViewBase.as b/frameworks/as/src/org/apache/flex/core/ViewBase.as index 4e923a1..afeb04d 100644 --- a/frameworks/as/src/org/apache/flex/core/ViewBase.as +++ b/frameworks/as/src/org/apache/flex/core/ViewBase.as @@ -81,8 +81,15 @@ package org.apache.flex.core public function set states(value:Array):void { _states = value; - if (getBeadByType(IStatesImpl) == null) - addBead(new (ValuesManager.valuesImpl.getValue(this, "iStatesImpl")) as IBead); + try{ + if (getBeadByType(IStatesImpl) == null) + addBead(new (ValuesManager.valuesImpl.getValue(this, "iStatesImpl")) as IBead); + } + //TODO: Need to handle this case more gracefully + catch(e:Error) + { + trace(e.message); + } }
