Skip to content

Commit

Permalink
fix for loop returns (#35)
Browse files Browse the repository at this point in the history
  • Loading branch information
nishils authored Mar 2, 2023
1 parent 37d9067 commit 21c7268
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ exports.do_milter_headers = function (connection, data) {
connection.logdebug(this, `milter.add_headers: ${JSON.stringify(data.milter.add_headers)}`);
for (const key of Object.keys(data.milter.add_headers)) {
const header_values = data.milter.add_headers[key];
if (!header_values) return;
if (!header_values) continue;

if (Object.prototype.toString.call(header_values) == '[object Array]') {
header_values.forEach(function (header_value, header_index) {
Expand Down Expand Up @@ -380,11 +380,11 @@ exports.get_clean = function (data, connection) {
const arrays = ['urls', 'emails', 'messages'];
for (const b of arrays) {
// collapse to comma separated string, so values get logged
if (!data[b]) return;
if (!data[b]) continue;

if (data[b].length) {
clean[b] = data[b].join(',');
return;
continue;
}

if (typeof(data[b]) == 'object') {
Expand Down

0 comments on commit 21c7268

Please sign in to comment.