From 21369bb4cf3213f7e494647d40aa4169873c1a84 Mon Sep 17 00:00:00 2001 From: Nikolai Ovtsinnikov Date: Thu, 7 Nov 2024 22:35:16 +0200 Subject: [PATCH] fix fileContentHash error in imap indexer, check for attachmentInfo beforehand --- 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; }