core: fix when tsdoc doesn't exist

This commit is contained in:
undefined committed 2021-07-05 11:48:10 +08:00
1 parent c5f9f86dd7
commit b8c67114e1
3 files changed
+6 -3

No files matched your search

+1 -1
View File
@@ -245,7 +245,7 @@ export async function getVnode(domainId: string, type: number, id: string, uid?:
if (!tdoc) throw new DiscussionNodeNotFoundError(id);
if (uid) {
const tsdoc = await model.getStatus(domainId, _id, uid);
tdoc.attend = tsdoc.attend || tsdoc.enroll;
tdoc.attend = tsdoc?.attend || tsdoc?.enroll;
}
return { ...tdoc, type, id };
}