Skip to content

Commit 67f8da0

Browse files
committed
Fixed mail.attachments parsing when variable is undefined.
1 parent 6fb3fe2 commit 67f8da0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ function parseUnread() {
9191
var attributes = null;
9292

9393
parser.on("end", function(mail) {
94-
if (!self.mailParserOptions.streamAttachments) {
94+
if (!self.mailParserOptions.streamAttachments && mail.attachments) {
9595
async.each(mail.attachments, function( attachment, callback) {
9696
fs.writeFile(self.attachmentOptions.directory + attachment.generatedFileName, attachment.content, function(err) {
9797
if(err) {

0 commit comments

Comments
 (0)