From 7daa0e35d5462c46ff4228638f2e9e5f30ed880d Mon Sep 17 00:00:00 2001 From: NickOvt Date: Thu, 7 Nov 2024 22:48:11 +0200 Subject: [PATCH] fix(imap-indexer): fix fileContentHash error in imap indexer, check for attachmentInfo beforehand ZMS-186 (#756) --- imap-core/lib/indexer/indexer.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/imap-core/lib/indexer/indexer.js b/imap-core/lib/indexer/indexer.js index ae53d9be..ea4aa603 100644 --- a/imap-core/lib/indexer/indexer.js +++ b/imap-core/lib/indexer/indexer.js @@ -626,11 +626,12 @@ class Indexer { mimeTree.attachmentMap[node.attachmentId] = id; let attachmentInfo = maildata.attachments && maildata.attachments.find(a => a.id === node.attachmentId); // get reference to attachment info + if (attachmentInfo && node.body) { attachmentInfo.size = node.body.length; } - if (fileContentHash) { + if (attachmentInfo && fileContentHash) { attachmentInfo.fileContentHash = fileContentHash; }