flex-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vadim Usoltsev (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (FLEX-34345) Spark DataGrid throws a Null Pointer Exception when data provider's item is being changed by item renderer
Date Thu, 29 May 2014 18:19:03 GMT

     [ https://issues.apache.org/jira/browse/FLEX-34345?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Vadim Usoltsev updated FLEX-34345:
----------------------------------

    Description: 
Exception in *GridViewLayout.as:1053* occurs when data item is being changed by item renderer.
The code:
{code:actionscript}
        for each (var renderer:IGridItemRenderer in visibleItemRenderers)            
        {
            var rowIndex:int = renderer.rowIndex; 
            ...
{code}
is not null safe, because visibleItemRenderers vector can contain null items under some indices,
made f.e. by code in *GridViewLayout.as:1753* :
{code:actionscript}
        const renderer:IGridItemRenderer = visibleItemRenderers[index];
        visibleItemRenderers[index] = null;
{code}
To  reproduce this, create DataGrid with data provider, that contain items with Date fields,
and create an ItemRenderer for that column with DateField component, that can change the date
in source data item. Error will be throwed when data item's field will be changed and *PropertyChangeEvent*
will be dispatched.

Simple check for "null" will probably be enough to fix this bug.

  was:
Exception in *GridViewLayout.as:1053* occurs when data item is being changed by item renderer.
The code:
{code:actionscript}
        for each (var renderer:IGridItemRenderer in visibleItemRenderers)            
        {
            var rowIndex:int = renderer.rowIndex; 
            ...
{code}
is not null safe, because visibleItemRenderers vector can contain null items under some indices,
made f.e. by code in *GridViewLayout.as:1753* :
{code:actionscript}
        const renderer:IGridItemRenderer = visibleItemRenderers[index];
        visibleItemRenderers[index] = null;
{code}
To  reproduce this, create DataGrid with data provider, that contain items with Date fields,
and create an ItemRenderer for that column with DateField component, that can change the date
in source data item. Error will be throwed when data item's field will be changed and *PropertyChangeEvent*
will be dispatched.

I think simple check for "null" will be enough to fix this bug.


> Spark DataGrid throws a Null Pointer Exception when data provider's item is being changed
by item renderer
> ----------------------------------------------------------------------------------------------------------
>
>                 Key: FLEX-34345
>                 URL: https://issues.apache.org/jira/browse/FLEX-34345
>             Project: Apache Flex
>          Issue Type: Bug
>          Components: Spark: DataGrid, Spark: Grid
>    Affects Versions: Adobe Flex SDK 4.5.1 (Release), Apache Flex 4.11.0, Apache Flex
4.12.1
>            Reporter: Vadim Usoltsev
>              Labels: datagrid, grid, itemrenderer, npe
>
> Exception in *GridViewLayout.as:1053* occurs when data item is being changed by item
renderer. The code:
> {code:actionscript}
>         for each (var renderer:IGridItemRenderer in visibleItemRenderers)           

>         {
>             var rowIndex:int = renderer.rowIndex; 
>             ...
> {code}
> is not null safe, because visibleItemRenderers vector can contain null items under some
indices, made f.e. by code in *GridViewLayout.as:1753* :
> {code:actionscript}
>         const renderer:IGridItemRenderer = visibleItemRenderers[index];
>         visibleItemRenderers[index] = null;
> {code}
> To  reproduce this, create DataGrid with data provider, that contain items with Date
fields, and create an ItemRenderer for that column with DateField component, that can change
the date in source data item. Error will be throwed when data item's field will be changed
and *PropertyChangeEvent* will be dispatched.
> Simple check for "null" will probably be enough to fix this bug.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Mime
View raw message