fix: check client.email exists
gitea/salix/pipeline/head There was a failure building this commit Details

This commit is contained in:
Vicent Llopis 2022-10-25 08:09:23 +02:00
parent fe95c45c42
commit 931a891f71
1 changed files with 2 additions and 3 deletions

View File

@ -25,10 +25,9 @@ module.exports = Self => {
const client = await Self.app.models.Client.findById(id, myOptions); const client = await Self.app.models.Client.findById(id, myOptions);
const emails = client.email ? client.email.split(',') : null;
const findParams = []; const findParams = [];
if (emails.length) { if (client.email) {
const emails = client.email.split(',');
for (let email of emails) for (let email of emails)
findParams.push({email: email}); findParams.push({email: email});
} }