From 2908b29a924b6610b0827e31cad0a70cd7ebed01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Germ=C3=A1n=20Jablo=C3=B1ski?= <43938777+GermanJablo@users.noreply.github.com> Date: Wed, 11 Dec 2024 09:40:13 -0300 Subject: [PATCH] node.__classes check is actually needed as long as the property is optional --- packages/lexical/src/LexicalEditorState.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/lexical/src/LexicalEditorState.ts b/packages/lexical/src/LexicalEditorState.ts index 1cc3015bac4..f31144fb978 100644 --- a/packages/lexical/src/LexicalEditorState.ts +++ b/packages/lexical/src/LexicalEditorState.ts @@ -57,7 +57,7 @@ function exportNodeToJSON( node: LexicalNode, ): SerializedNode { const serializedNode = node.exportJSON(); - if (Object.keys(node.__classes).length > 0) { + if (node.__classes && Object.keys(node.__classes).length > 0) { serializedNode.classes = node.__classes; } const nodeClass = node.constructor;