Skip to content

Commit 24c4e3e

Browse files
fix: guarding replaceSpecialCharacters against non-strings
1 parent 5e944d2 commit 24c4e3e

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

  • packages/super-editor/src/core/super-converter

packages/super-editor/src/core/super-converter/exporter.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2283,7 +2283,10 @@ export class DocxExporter {
22832283
if (elements) {
22842284
if (name === 'w:instrText') {
22852285
tags.push(elements[0].text);
2286-
} else if (name === 'w:t' || name === 'w:delText' || name === 'wp:posOffset') {
2286+
} else if (
2287+
(name === 'w:t' || name === 'w:delText' || name === 'wp:posOffset') &&
2288+
typeof elements[0].text === 'string'
2289+
) {
22872290
const text = this.#replaceSpecialCharacters(elements[0].text);
22882291
tags.push(text);
22892292
} else {

0 commit comments

Comments
 (0)