From f2e74954d79e3ff28e2ed950e6fae8c92700e787 Mon Sep 17 00:00:00 2001 From: Fabian Braun Date: Tue, 7 Jan 2025 00:54:00 +0100 Subject: [PATCH] Add check for existence of classList in node --- private/js/tiptap_plugins/cms.styles.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/private/js/tiptap_plugins/cms.styles.js b/private/js/tiptap_plugins/cms.styles.js index f586931..7eb27be 100644 --- a/private/js/tiptap_plugins/cms.styles.js +++ b/private/js/tiptap_plugins/cms.styles.js @@ -174,7 +174,9 @@ function validateAttributes(node, styleAttributes) { if (!styleAttributes) { return true; } - + if (!node?.classList) { + return false; + } if (styleAttributes.class) { const requiredClasses = styleAttributes.class.split(' '); if (!requiredClasses.every(cls => node.classList.contains(cls))) {