diff --git a/packages/server/src/services/collaboration.service.ts b/packages/server/src/services/collaboration.service.ts index fe08865..2ce9ebc 100644 --- a/packages/server/src/services/collaboration.service.ts +++ b/packages/server/src/services/collaboration.service.ts @@ -267,13 +267,14 @@ export class CollaborationService { if (docType === 'document') { const data = await this.documentService.findById(targetId); + if (data && !data.title) { await this.documentService.updateDocument({ id: userId } as IUser, targetId, { title: '未命名文档', }); } - if (editable) { + if (data && editable) { const content = data.content; const json = JSON.parse(content).default; const mentionUsers = findMentions(json);