From 776db2bc7fea68505f5930f124003d04fe6d019d Mon Sep 17 00:00:00 2001 From: fantasticit Date: Tue, 10 May 2022 10:25:53 +0800 Subject: [PATCH] fix: fix jserror --- packages/client/src/tiptap/prose-utils/node.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/client/src/tiptap/prose-utils/node.ts b/packages/client/src/tiptap/prose-utils/node.ts index a4b2812..b21e355 100644 --- a/packages/client/src/tiptap/prose-utils/node.ts +++ b/packages/client/src/tiptap/prose-utils/node.ts @@ -2,19 +2,19 @@ import { Node } from 'prosemirror-model'; import { EditorState } from 'prosemirror-state'; export function isTitleNode(node: Node): boolean { - return node.type.name === 'title'; + return node && node.type.name === 'title'; } export function isBulletListNode(node: Node): boolean { - return node.type.name === 'bulletList'; + return node && node.type.name === 'bulletList'; } export function isOrderedListNode(node: Node): boolean { - return node.type.name === 'orderedList'; + return node && node.type.name === 'orderedList'; } export function isTodoListNode(node: Node): boolean { - return node.type.name === 'taskList'; + return node && node.type.name === 'taskList'; } export function isListNode(node: Node): boolean {