Skip to content

Commit 95bc33c

Browse files
authored
fix: add check for session existence before writing to session writeStream in message-handler (#843)
1 parent 0ce50fd commit 95bc33c

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

lib/message-handler.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2102,7 +2102,7 @@ class MessageHandler {
21022102
let { sourceUid, existsEntries, mailboxData, removeEntries, targetData, destinationUid } = data;
21032103

21042104
// Show Expunged
2105-
if (sourceUid.length && options.showExpunged) {
2105+
if (options.session && sourceUid.length && options.showExpunged) {
21062106
options.session.writeStream.write({
21072107
tag: '*',
21082108
command: String(options.session.selected.uidList.length),
@@ -2217,7 +2217,7 @@ class MessageHandler {
22172217
modseq: newModseq
22182218
});
22192219

2220-
if (options.showExpunged) {
2220+
if (options.session && options.showExpunged) {
22212221
options.session.writeStream.write(options.session.formatResponse('EXPUNGE', messageUid));
22222222
}
22232223
}

0 commit comments

Comments
 (0)