diff --git a/src/toolbars/PreviewerBubble.js b/src/toolbars/PreviewerBubble.js index 75242380..93da69b8 100644 --- a/src/toolbars/PreviewerBubble.js +++ b/src/toolbars/PreviewerBubble.js @@ -347,6 +347,9 @@ export default class PreviewerBubble { } $getClosestNode(node, targetNodeName) { + if (!node || !node.tagName) { + return false; + } if (node.tagName === targetNodeName) { return node; } diff --git a/src/toolbars/Toc.js b/src/toolbars/Toc.js index f6237bfc..c4d86c83 100644 --- a/src/toolbars/Toc.js +++ b/src/toolbars/Toc.js @@ -175,6 +175,9 @@ export default class Toc { } $getClosestNode(node, targetNodeName) { + if (!node || !node.tagName) { + return false; + } if (node.tagName === targetNodeName) { return node; } diff --git a/src/utils/tableContentHandler.js b/src/utils/tableContentHandler.js index d001618d..232d846c 100644 --- a/src/utils/tableContentHandler.js +++ b/src/utils/tableContentHandler.js @@ -370,6 +370,9 @@ export default class TableHandler { } $getClosestNode(node, targetNodeName) { + if (!node || !node.tagName) { + return false; + } if (node.tagName === targetNodeName) { return node; }