diff --git a/packages/common/src/utils/text.ts b/packages/common/src/utils/text.ts index cadd5fe19..5eaadfb15 100644 --- a/packages/common/src/utils/text.ts +++ b/packages/common/src/utils/text.ts @@ -10,7 +10,7 @@ export const getTextManages = (element: PlaitElement) => { export const getFirstTextManage = (element: PlaitElement) => { const textManage = getTextManages(element)[0]; if (!textManage) { - throw new Error('can not find textManage'); + console.warn('can not find textManage'); } return textManage; }; diff --git a/packages/mind/src/utils/node/common.ts b/packages/mind/src/utils/node/common.ts index b507c0589..d163850fc 100644 --- a/packages/mind/src/utils/node/common.ts +++ b/packages/mind/src/utils/node/common.ts @@ -5,7 +5,7 @@ import { ExitOrigin } from '@plait/text'; export function editTopic(element: MindElement) { const textManage = getFirstTextManage(element); - textManage.edit((origin: ExitOrigin) => { + textManage?.edit((origin: ExitOrigin) => { if (origin === ExitOrigin.default) { } });