fix jserror

pull/198/head
fantasticit 2022-09-18 13:12:01 +08:00
parent 4f8549b8ba
commit d5a1d824a9
1 changed files with 2 additions and 2 deletions

View File

@ -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;