Filter out blank lines

It seems like sometimes (perhaps with pcp dstat output that didn't
happen before) we can get a blank line at the end.  Make sure all
lines have a length before processing.

Change-Id: Id8cdaa2e4b7bcf2bcb27322eaa6f0ce8d21960ea
This commit is contained in:
Ian Wienand 2021-10-22 15:40:10 +11:00
parent 8f5a2eae5c
commit a928b67b4f

View File

@ -184,7 +184,7 @@ function processCSV(csv, filename) {
line = lines[lindex].replace(/"/g, '').split(',');
for (var cindex = 0; cindex < line.length; cindex++) {
lmap = map[cindex];
if (lmap != null && lmap.name === 'time') {
if (lmap != null && lmap.name === 'time' && line[cindex].length > 0) {
xValues.push(Date.parse(line[cindex].replace(/(\d+)-(\d+)\s+(\d+):(\d+):(\d+)/, '1942/$2/$1 $3:$4:$5')));
break;
}