Skip to content
This repository has been archived by the owner on Dec 12, 2024. It is now read-only.

Commit

Permalink
fix: fixed check for array
Browse files Browse the repository at this point in the history
  • Loading branch information
titanism committed Jun 14, 2022
1 parent c14515f commit 21820aa
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2565,7 +2565,7 @@ class ForwardEmail {
const info = await this.sendEmail(options, session);
this.config.logger.info('sent email', { info, options, session });

if (info.accepted.length > 0) {
if (info.accepted && info.accepted.length > 0) {
// add the masked recipient to the final accepted array
// (we don't want to reveal forwarding config to client SMTP servers)
if (accepted.indexOf(recipient.recipient) === -1)
Expand Down Expand Up @@ -2627,7 +2627,7 @@ class ForwardEmail {
}
}

if (info.rejectedErrors.length > 0) {
if (info.rejectedErrors && info.rejectedErrors.length > 0) {
for (const err of info.rejectedErrors) {
this.config.logger.error(err, { options, session });

Expand Down

0 comments on commit 21820aa

Please sign in to comment.