Skip to content

Commit

Permalink
fix fileContentHash error in imap indexer, check for attachmentInfo b…
Browse files Browse the repository at this point in the history
…eforehand
  • Loading branch information
NickOvt committed Nov 7, 2024
1 parent 7760019 commit 21369bb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion imap-core/lib/indexer/indexer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 21369bb

Please sign in to comment.