Skip to content

Commit f413b18

Browse files
authored
fix: check for undefined headerMatrix resolves #1506 (#1507)
1 parent 70a832e commit f413b18

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/core/src/api/nodeConversions/nodeToBlock.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,13 +112,13 @@ export function contentNodeToTableContent<
112112
});
113113

114114
for (let i = 0; i < headerMatrix.length; i++) {
115-
if (headerMatrix[i].every((isHeader) => isHeader)) {
115+
if (headerMatrix[i]?.every((isHeader) => isHeader)) {
116116
ret.headerRows = (ret.headerRows ?? 0) + 1;
117117
}
118118
}
119119

120120
for (let i = 0; i < headerMatrix[0]?.length; i++) {
121-
if (headerMatrix.every((row) => row[i])) {
121+
if (headerMatrix?.every((row) => row[i])) {
122122
ret.headerCols = (ret.headerCols ?? 0) + 1;
123123
}
124124
}

0 commit comments

Comments
 (0)