Skip to content

Commit 26fb793

Browse files
authored
BUG FIX: Some spreadsheet files report fully empty rows as undefined rather than [] for some reason (#120)
1 parent cc76a21 commit 26fb793

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/importer/backend.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,12 +255,14 @@ function getMergedRows(sheet, start, end) {
255255
for(let index = start; index <= end; index++) {
256256
result.push(getMergedRow(data, merges, index));
257257
}
258+
258259
return result;
259260
}
260261

261262
// Given a row, return the columns from start to end.
262263
// This will extract the desired column range, padding with "undefined"s if the row ends too soon.
263264
function extractColsFromRow(row, start, end) {
265+
if(row === undefined) return [];
264266
// Slice row; but this may result in fewer elements than we want if the row
265267
// wasn't that long to begin with
266268
const sliced = row.slice(start, end);

0 commit comments

Comments
 (0)