Skip to content

Commit

Permalink
fix: Console error when opening context menu on tree table (#2047)
Browse files Browse the repository at this point in the history
Resolves #2029

**Changes Implemented:** 
- Added null check when call formatValue function, to ensure that
it is only called when it is defined

```
  • Loading branch information
AkshatJawne authored May 31, 2024
1 parent 8e6b6da commit 77bea7d
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions packages/iris-grid/src/IrisGridTreeTableModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,15 +176,16 @@ class IrisGridTreeTableModel extends IrisGridTableModelTemplate<
this.viewportData.rows[r - this.viewportData.offset];
assertNotNull(intersection.startColumn);
assertNotNull(intersection.endColumn);
for (
let c = intersection.startColumn;
c <= intersection.endColumn;
c += 1
) {
assertNotNull(formatValue);
resultRow.push(
formatValue(viewportRow.data.get(c)?.value, this.columns[c])
);
if (formatValue != null) {
for (
let c = intersection.startColumn;
c <= intersection.endColumn;
c += 1
) {
resultRow.push(
formatValue(viewportRow.data.get(c)?.value, this.columns[c])
);
}
}
result.push(resultRow);
}
Expand Down

0 comments on commit 77bea7d

Please sign in to comment.