Skip to content

Commit 7daa0e3

Browse files
authored
fix(imap-indexer): fix fileContentHash error in imap indexer, check for attachmentInfo beforehand ZMS-186 (#756)
1 parent 7760019 commit 7daa0e3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

imap-core/lib/indexer/indexer.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -626,11 +626,12 @@ class Indexer {
626626
mimeTree.attachmentMap[node.attachmentId] = id;
627627

628628
let attachmentInfo = maildata.attachments && maildata.attachments.find(a => a.id === node.attachmentId); // get reference to attachment info
629+
629630
if (attachmentInfo && node.body) {
630631
attachmentInfo.size = node.body.length;
631632
}
632633

633-
if (fileContentHash) {
634+
if (attachmentInfo && fileContentHash) {
634635
attachmentInfo.fileContentHash = fileContentHash;
635636
}
636637

0 commit comments

Comments
 (0)