From f50b88716b72f24572d871756060f603bdf97d1e Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Tue, 9 Mar 2021 22:45:40 -0800 Subject: [PATCH] fix: Handle document Id in document structure does not exist in db closes #1938 --- server/utils/zip.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/server/utils/zip.js b/server/utils/zip.js index 4aaf13669..50b678783 100644 --- a/server/utils/zip.js +++ b/server/utils/zip.js @@ -9,6 +9,9 @@ import { getFileByKey } from "./s3"; async function addToArchive(zip, documents) { for (const doc of documents) { const document = await Document.findByPk(doc.id); + if (!document) { + continue; + } let text = document.toMarkdown(); const attachments = await Attachment.findAll({