NUKnightLab / NUKnightLab/TimelineJS3

Blank column headers throw cryptic error

Open
#663 0 comments 0 reactions 0 assignees View on GitHub

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.