From 6b05bdc3e16e76fb29ac58b2d9648a982432c896 Mon Sep 17 00:00:00 2001 From: Dylan Phelan Date: Fri, 7 Jan 2022 13:59:28 -0500 Subject: [PATCH 1/2] Fixed improper demorgans-law case logic for logger warning --- src/application/tools/emailNotifications.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/application/tools/emailNotifications.js b/src/application/tools/emailNotifications.js index d3ddb755..21ed7e14 100644 --- a/src/application/tools/emailNotifications.js +++ b/src/application/tools/emailNotifications.js @@ -58,7 +58,13 @@ async function sendEmailNotification(notificationInfo, errors, debug = false) { } // Ensure that the tlsRejectUnauthorized property is a boolean - if (notificationInfo.tlsRejectUnauthorized && (notificationInfo.tlsRejectUnauthorized !== true || notificationInfo.tlsRejectUnauthorized !== false)) { + if ( + notificationInfo.tlsRejectUnauthorized + && !( + notificationInfo.tlsRejectUnauthorized === true + || notificationInfo.tlsRejectUnauthorized === false + ) + ) { logger.warn('The notificationInfo.tlsRejectUnauthorized should be a boolean value. The value provided will not be used.'); } From f34f02526288e27d0cd81298b1e997448fec1fdc Mon Sep 17 00:00:00 2001 From: Dylan Phelan Date: Mon, 10 Jan 2022 10:49:12 -0500 Subject: [PATCH 2/2] use boolean check instead of complex logic --- src/application/tools/emailNotifications.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/application/tools/emailNotifications.js b/src/application/tools/emailNotifications.js index 21ed7e14..138461b8 100644 --- a/src/application/tools/emailNotifications.js +++ b/src/application/tools/emailNotifications.js @@ -60,10 +60,7 @@ async function sendEmailNotification(notificationInfo, errors, debug = false) { // Ensure that the tlsRejectUnauthorized property is a boolean if ( notificationInfo.tlsRejectUnauthorized - && !( - notificationInfo.tlsRejectUnauthorized === true - || notificationInfo.tlsRejectUnauthorized === false - ) + && typeof notificationInfo.tlsRejectUnauthorized !== 'boolean' ) { logger.warn('The notificationInfo.tlsRejectUnauthorized should be a boolean value. The value provided will not be used.'); }