Skip to content
This repository was archived by the owner on Mar 6, 2024. It is now read-only.
This repository was archived by the owner on Mar 6, 2024. It is now read-only.

Add null check to DataGrid actions setter #440

@bryanvb

Description

@bryanvb

When wrapping the DataGrid and binding the actions input to a local variable in the wrapper we get an exception if the wrapper's input is not set to something.

For example:

@Component({
    selector: "vcd-rest-datagrid",
    template: `<vcd-datagrid [actions]="actions"></vcd-datagrid>`
})
export class VcdRestDatagridComponent {
    @Input()
    actions: ActionItem<R, unknown>[];
}

This will execute the DataGrid's actions setter with an undefined value. The setter then attempts to iterate the undefined value throwing an exception. Current workaround is to initialize the wrapper's actions variable to [] so that it can be iterated.

https://github.com/vmware/vmware-cloud-director-ui-components/blob/faf1a098a0875303835749cce62250c2a1c16c23/projects/components/src/datagrid/datagrid.component.ts#L358

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions