From d5a1d824a97d5d5f665733f038f38db8eff51a7d Mon Sep 17 00:00:00 2001 From: fantasticit Date: Sun, 18 Sep 2022 13:12:01 +0800 Subject: [PATCH] fix jserror --- packages/client/src/tiptap/core/menus/table/bubble.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/client/src/tiptap/core/menus/table/bubble.tsx b/packages/client/src/tiptap/core/menus/table/bubble.tsx index d0aa7c0e..be1a0bfc 100644 --- a/packages/client/src/tiptap/core/menus/table/bubble.tsx +++ b/packages/client/src/tiptap/core/menus/table/bubble.tsx @@ -28,10 +28,10 @@ export const TableBubbleMenu = ({ editor }) => { const getRenderContainer = useCallback((node) => { let container = node; // 文本节点 - if (!container.tag) { + if (container && !container.tag) { container = node.parentElement; } - while (container.tagName !== 'TABLE') { + while (container && container.tagName !== 'TABLE') { container = container.parentElement; } return container.parentElement;