Skip to content

Commit 4b54b94

Browse files
authored
Merge pull request #432 from INCF/chrisfilo-patch-12
[WIP] Improve header check robustness
2 parents 7bd54b4 + e0f70d8 commit 4b54b94

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

validators/tsv.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,21 +86,19 @@ var TSV = function TSV (file, contents, fileList, callback) {
8686

8787
// events.tsv
8888
if (file.name.endsWith('_events.tsv')) {
89-
if (headers[0] !== "onset"){
89+
if ((headers.length == 0) || (headers[0] !== "onset")){
9090
issues.push(new Issue({
9191
file: file,
9292
evidence: headers,
9393
line: 1,
94-
character: rows[0].indexOf(headers[0]),
9594
code: 20
9695
}));
9796
}
98-
if (headers[1].trim() !== "duration"){
97+
if ((headers.length == 1) || (headers[1].trim() !== "duration")){
9998
issues.push(new Issue({
10099
file: file,
101100
evidence: headers,
102101
line: 1,
103-
character: rows[0].indexOf(headers[1]),
104102
code: 21
105103
}));
106104
}

0 commit comments

Comments
 (0)