Skip to content

Commit 8e6d873

Browse files
authored
fix(igxPivot): Add null check in case there's no initial data. (#15830)
1 parent 55d5655 commit 8e6d873

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

projects/igniteui-angular/src/lib/grids/pivot-grid/pivot-header-row.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ export class IgxPivotHeaderRowComponent extends IgxGridHeaderRowComponent implem
187187
if (columnDimensions.length === 0) {
188188
return 1;
189189
}
190-
let totalDepth = columnDimensions.map(x => this.grid.data.length > 0 ? PivotUtil.getDimensionDepth(x) + 1 : 0).reduce((acc, val) => acc + val);
190+
let totalDepth = columnDimensions.map(x => this.grid.data?.length > 0 ? PivotUtil.getDimensionDepth(x) + 1 : 0).reduce((acc, val) => acc + val);
191191
if (this.grid.hasMultipleValues) {
192192
totalDepth += 1;
193193
}

0 commit comments

Comments
 (0)