diff --git a/validators/tsv.js b/validators/tsv.js index 3d1f28180..37ca386f0 100644 --- a/validators/tsv.js +++ b/validators/tsv.js @@ -86,21 +86,19 @@ var TSV = function TSV (file, contents, fileList, callback) { // events.tsv if (file.name.endsWith('_events.tsv')) { - if (headers[0] !== "onset"){ + if ((headers.length == 0) || (headers[0] !== "onset")){ issues.push(new Issue({ file: file, evidence: headers, line: 1, - character: rows[0].indexOf(headers[0]), code: 20 })); } - if (headers[1].trim() !== "duration"){ + if ((headers.length == 1) || (headers[1].trim() !== "duration")){ issues.push(new Issue({ file: file, evidence: headers, line: 1, - character: rows[0].indexOf(headers[1]), code: 21 })); }