Add null check to DataGrid actions setter
bryanvb opened this issue · 0 comments
bryanvb commented
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.