fix: share.document can be null when document is deleted

closes #3724
This commit is contained in:
Tom Moor
2022-07-02 19:56:15 +02:00
parent f744d488f6
commit 0c30d2bb34
3 changed files with 12 additions and 10 deletions

View File

@@ -5,8 +5,8 @@ export default function present(share: Share, isAdmin = false) {
const data = {
id: share.id,
documentId: share.documentId,
documentTitle: share.document.title,
documentUrl: share.document.url,
documentTitle: share.document?.title,
documentUrl: share.document?.url,
published: share.published,
url: `${share.team.url}/share/${share.id}`,
createdBy: presentUser(share.user),