NUKnightLab / NUKnightLab/TimelineJS3
Blank column headers throw cryptic error
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 3.2k
- Forks
- 645
- PR merge metrics
- No merged PRs in 30d
Description
a Zendesk user reported an unexpected message,
Error: TypeError: t is null
In this case, that error originated in CSV.js where we are now trimming whitespace from column headers, because this user had an extra column with a null value in the header position.
We should protect against this error, perhaps by replacing any null column headers with variants of "untitled". We must replace with something, because in this part of the code, the header row is being prepared as the keys used to reference row values in a JS object representing each parsed row -- simply removing the null without removing it from every data row would lead to other problems.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in src/js/core/CSV.js at the column-header trimming logic around line 86, and trace how header values become keys for parsed row objects. Handle null or blank headers without changing the alignment between headers and data rows; done means the parser produces usable keys and no longer throws the reported TypeError.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- data
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100