[
https://issues.apache.org/jira/browse/FLEX-28913?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Mark Kessler resolved FLEX-28913.
---------------------------------
Resolution: Not A Problem
Able to reproduce the RTE. However it's not a bug. The example from the Adobe
site [1] shows changing the list (numberList) before it has been fully/created.
The modified example app below shows a simple test for existence before
accessing it.
[1] http://bugs.adobe.com/jira/browse/SDK-31980
<?xml version="1.0" encoding="utf-8"?>
<!---
Test application
-->
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
creationComplete="onCreationComplete();"
resize="application1_resizeHandler(event)" >
<fx:Script>
<![CDATA[
import mx.collections.ArrayCollection;
import mx.events.ResizeEvent;
[Bindable]
protected var acTestData:ArrayCollection = new ArrayCollection();
protected function application1_resizeHandler(event:ResizeEvent):void
{
if (numberList)
{
numberList.dataProvider = null;
numberList.height=300
}
}
protected function onCreationComplete():void
{
acTestData.addItem(["Zero"]);
acTestData.addItem(["One"]);
acTestData.addItem(["Two"]);
acTestData.addItem(["Three"]);
acTestData.addItem(["Four"]);
acTestData.addItem(["Five"]);
acTestData.addItem(["Six"]);
acTestData.addItem(["Seven"]);
acTestData.addItem(["Eight"]);
acTestData.addItem(["Nine"]);
}
]]>
</fx:Script>
<s:layout>
<s:VerticalLayout horizontalAlign="center" verticalAlign="middle"
gap="0" />
</s:layout>
<s:List id="numberList" dataProvider="{acTestData}" height="200"
scrollSnappingMode="trailingEdge" />
</s:Application>
> Scroller's snapElement needs additional check for null dataprovider
> -------------------------------------------------------------------
>
> Key: FLEX-28913
> URL: https://issues.apache.org/jira/browse/FLEX-28913
> Project: Apache Flex
> Issue Type: Bug
> Components: Spark: Scroller
> Affects Versions: Adobe Flex SDK Previous
> Environment: Affected OS(s): All OS Platforms
> Language Found: English
> Reporter: Adobe JIRA
> Assignee: Mark Kessler
> Labels: easyfix, easytest
> Attachments: SparkAlert.mxml
>
>
> Found in Adobe ThRead. This occurs when resizing a list with no elements (or
> dataprovider=null) + scrollsnapping enabled.
>
> Actual Results:
> TypeError: Error #1009: Cannot access a property or method of a null object
> reference.
> at
> spark.components::Scroller/http://www.adobe.com/2006/flex/mx/internal::snapElement()[E:\dev\4.y\frameworks\projects\spark\src\spark\components\Scroller.as:1518]
> at
> spark.components::Scroller/checkScrollPosition()[E:\dev\4.y\frameworks\projects\spark\src\spark\components\Scroller.as:1750]
> at
> spark.components::Scroller/handleSizeChange()[E:\dev\4.y\frameworks\projects\spark\src\spark\components\Scroller.as:1766]
> at
> spark.components::Scroller/handleSizeChangeOnUpdateComplete()[E:\dev\4.y\frameworks\projects\spark\src\spark\components\Scroller.as:2048]
> at flash.events::EventDispatcher/dispatchEventFunction()
> at flash.events::EventDispatcher/dispatchEvent()
> at
> mx.core::UIComponent/dispatchEvent()[E:\dev\4.y\frameworks\projects\framework\src\mx\core\UIComponent.as:13152]
> at
> mx.managers::LayoutManager/doPhasedInstantiation()[E:\dev\4.y\frameworks\projects\framework\src\mx\managers\LayoutManager.as:844]
> at
> mx.managers::LayoutManager/doPhasedInstantiationCallback()[E:\dev\4.y\frameworks\projects\framework\src\mx\managers\LayoutManager.as:1180]
> at flash.utils::Timer/_timerDispatch()
> at flash.utils::Timer/tick()
>
> Expected Results:
>
>
> Workaround (if any):
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira