Skip to content

Commit

Permalink
Add check for existence of classList in node
Browse files Browse the repository at this point in the history
  • Loading branch information
fsbraun committed Jan 6, 2025
1 parent 120fe53 commit f2e7495
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion private/js/tiptap_plugins/cms.styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -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))) {
Expand Down

0 comments on commit f2e7495

Please sign in to comment.