Skip to content

Commit

Permalink
node.__classes check is actually needed as long as the property is op…
Browse files Browse the repository at this point in the history
…tional
  • Loading branch information
GermanJablo committed Dec 11, 2024
1 parent 66d0679 commit 2908b29
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/lexical/src/LexicalEditorState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ function exportNodeToJSON<SerializedNode extends SerializedLexicalNode>(
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;
Expand Down

0 comments on commit 2908b29

Please sign in to comment.