Skip to content

Commit

Permalink
Fixes datatable crash when dimension is empty
Browse files Browse the repository at this point in the history
Fixes #20679
  • Loading branch information
Usiel committed Jul 12, 2022
1 parent 8d4994a commit 459b313
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -314,9 +314,9 @@ export const useTableColumns = (
const isOriginalTimeColumn =
originalFormattedTimeColumns.includes(key);
return {
id: key,
// react-table requires a non-empty id, therefore we introduce a fallback value in case the key is empty
id: key || index,
accessor: row => row[key],
// When the key is empty, have to give a string of length greater than 0
Header:
colType === GenericDataType.TEMPORAL &&
typeof firstValue !== 'string' ? (
Expand Down

0 comments on commit 459b313

Please sign in to comment.