Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Console error when opening context menu on tree table #2047

Merged
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions packages/iris-grid/src/IrisGridTreeTableModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,9 +181,8 @@ class IrisGridTreeTableModel extends IrisGridTableModelTemplate<
c <= intersection.endColumn;
c += 1
) {
assertNotNull(formatValue);
resultRow.push(
formatValue(viewportRow.data.get(c)?.value, this.columns[c])
formatValue?.(viewportRow.data.get(c)?.value, this.columns[c])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems if formatValue is not defined, there is no point in entering the for loop at all. I would check before the loop.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, just tested and it seems like this also works, but definitely more efficient (since we are not going into the loop if its not defined anymore). Pushed change

);
}
result.push(resultRow);
Expand Down
Loading