[ https://issues.apache.org/jira/browse/FLEX-32998?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Justin Mclean updated FLEX-32998: --------------------------------- Labels: easyfix easytest (was: ) > NullPointerException in AdvancedDataGrid.getFieldSortInfo > --------------------------------------------------------- > > Key: FLEX-32998 > URL: https://issues.apache.org/jira/browse/FLEX-32998 > Project: Apache Flex > Issue Type: Bug > Components: ADG:MultiColumnSorting > Affects Versions: Adobe Flex SDK 4.1 (Release) > Environment: Affected OS(s): All OS Platforms > Affected OS(s): All OS Platforms > Language Found: English > Reporter: Adobe JIRA > Labels: easyfix, easytest > > Steps to reproduce: > Create an advanced datagrid with custom columnRenderer and Custom header > renderer. > (In my application, i have to recreate the columns in the datagrid every time > i fetch data from backend.) > Actual Results: > During this process we get a null pointer exception. > TypeError: Error #1009: Cannot access a property or method of a null object > reference. > at mx.controls::AdvancedDataGrid/getFieldSortInfo() > at > mx.controls.advancedDataGridClasses::AdvancedDataGridSortItemRenderer/getFieldSortInfo() > at > mx.controls.advancedDataGridClasses::AdvancedDataGridSortItemRenderer/commitProperties() > at mx.core::UIComponent/validateProperties() > at mx.managers::LayoutManager/validateProperties() > at mx.managers::LayoutManager/doPhasedInstantiation() > at mx.managers::LayoutManager/validateNow() > at mx.core::Application/resizeHandler() > at mx.core::Application/commitProperties() > at mx.core::UIComponent/validateProperties() > at mx.managers::LayoutManager/validateProperties() > at mx.managers::LayoutManager/doPhasedInstantiation() > at mx.managers::LayoutManager/doPhasedInstantiationCallback() > at flash.utils::Timer/_timerDispatch() > at flash.utils::Timer/tick() > > When i build my application with SDK 3.5, this bug does not exist. But with > SDK 4.1, this is consistently reproducible. > More detailed inspection into the AdvancedDataGrid source code shows the > following insights. > In the method > mx.controls.advancedDataGridClasses.AdvancedDataGridSortItemRenderer.getFieldSortInfo(), > error happens in the following line: > return grid.getFieldSortInfo(grid.columns[listData.columnIndex]); > Here grid.columns[listData.columnIndex] returns null. In short, > listData.columnIndex has value higher than the actual number of columns (not > supposed to happen) > Work Around / Proposed Solution > ------------------------------- > If we can put a null check around grid.columns[listData.columnIndex], this > issue will get fixed. > Can we get this fixed as soon as possible. -- 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