Skip to content

Commit 779fe00

Browse files
authored
Merge pull request #1934 from mlarghydracept/csv_empty_lines
Fix for empty lines in CSV
2 parents a5d3fcf + e2e29de commit 779fe00

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/io/files.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -625,9 +625,9 @@ p5.prototype.loadTable = function (path) {
625625
var row;
626626
for (i = 0; i < records.length; i++) {
627627
//Handles row of 'undefined' at end of some CSVs
628-
if (i === records.length - 1 && records[i].length === 1) {
629-
if (records[i][0] === 'undefined') {
630-
break;
628+
if (records[i].length === 1) {
629+
if (records[i][0] === 'undefined' || records[i][0] === '') {
630+
continue;
631631
}
632632
}
633633
row = new p5.TableRow();

0 commit comments

Comments
 (0)