Fix Excel newlines with potential null values in tt-table component.

This commit is contained in:
2024-05-28 11:13:21 +02:00
parent 0409a04d27
commit 6971d03848

View File

@@ -453,7 +453,7 @@ Vue.component('tt-table', {
for (const cell in ws) {
if (cell.startsWith('!')) continue; // Skip non-cell properties like '!ref'
const cellValue = ws[cell].v;
if (cellValue.toString().includes('\n')) {
if (cellValue?.toString().includes('\n')) {
// console.log('Found newline in cell:', cell, cellValue);
if (!ws[cell].s) ws[cell].s = {};
ws[cell].s.alignment = {wrapText: true, vertical: 'center'};