From e71e58561cfdf5cd016105ebfaab69142302a218 Mon Sep 17 00:00:00 2001 From: sunsonliu Date: Mon, 18 Nov 2024 20:10:12 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8Dpreview=20hover?= =?UTF-8?q?=E6=97=B6=E6=8A=A5=E9=94=99=E7=9A=84=E9=97=AE=E9=A2=98=20(#980)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/toolbars/PreviewerBubble.js | 3 +++ src/toolbars/Toc.js | 3 +++ src/utils/tableContentHandler.js | 3 +++ 3 files changed, 9 insertions(+) diff --git a/src/toolbars/PreviewerBubble.js b/src/toolbars/PreviewerBubble.js index 75242380e..93da69b82 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 f6237bfcb..c4d86c838 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 d001618d7..232d846c9 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; }