Skip to content

Inconsistent null handling in ComponentDataGenerator #6825

@schwarzwald

Description

@schwarzwald

Description

There is an inconsistency in the handling of null values in the ComponentDataGenerator which can cause unexpected NullPointerExceptions.

In the method createComponent a null is handled gracefully and an empty Text is used as content.
But if the grid is refreshed and the components are re-rendered, the refreshData method in AbstractComponentDataGenerator calls updateComponent which does not perform this null handling, and it inevitably encounters a null pointer.

Expected outcome

The null values returned by ComponentRenderers should be accepted in both cases - when creating the cell and when updating the cell content.

Steps to reproduce

1.) Create a grid with component renderer which returns null as value.
2.) Call DataProvider#refreshItem on any row

Environment

Vaadin version(s): 24.5.4

Browsers

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions