flex-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From João Fernandes (JIRA) <j...@apache.org>
Subject [jira] [Created] (FLEX-34011) Axis Render throws RTE when axis is null
Date Mon, 23 Dec 2013 17:03:50 GMT
João Fernandes created FLEX-34011:
-------------------------------------

             Summary: Axis Render throws RTE when axis is null
                 Key: FLEX-34011
                 URL: https://issues.apache.org/jira/browse/FLEX-34011
             Project: Apache Flex
          Issue Type: Bug
          Components: Charts
    Affects Versions: Apache Flex 4.11.0
         Environment: Any
            Reporter: João Fernandes
            Priority: Minor


When a CartesianChart is initialized with a null Axis, which can be created in the future
an propagated through bindings, the chart throws RTE because the value is not validated if
it's null or not.

In AxisRenderer, 

   public function set axis(value:IAxis):void
    {
        if (_axis)
        {
            _axis.removeEventListener("axisChange", axisChangeHandler, false);
            _axis.removeEventListener("titleChange", titleChangeHandler, false);
        }

        _axis = value;

        value.addEventListener("axisChange", axisChangeHandler,
                               false, 0, true);
        value.addEventListener("titleChange", titleChangeHandler,
                               false, 0, true);
    }


should be 

   public function set axis(value:IAxis):void
    {
        if (_axis)
        {
            _axis.removeEventListener("axisChange", axisChangeHandler, false);
            _axis.removeEventListener("titleChange", titleChangeHandler, false);
        }

        _axis = value;
       if(value)
       {
        value.addEventListener("axisChange", axisChangeHandler,
                               false, 0, true);
        value.addEventListener("titleChange", titleChangeHandler,
                               false, 0, true);
       }
    }



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

Mime
View raw message