Skip to content

Commit 9361aa6

Browse files
committed
fix: check input type before calling string match on it
1 parent 006e9f8 commit 9361aa6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/excel-builder-vanilla/src/Excel/SharedStrings.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export class SharedStrings {
4242

4343
while (l--) {
4444
const clone = template.cloneNode(true);
45-
if (strings[l]?.match(/\s+/)) {
45+
if (typeof strings[l] === 'string' && strings[l].match(/\s+/)) {
4646
clone.firstChild!.setAttribute('xml:space', 'preserve');
4747
}
4848
clone.firstChild!.firstChild!.nodeValue = strings[l];

0 commit comments

Comments
 (0)