MASTER_hotfix: check if email exists #1103

Merged
joan merged 1 commits from 4708-client.basic-data into master 2022-10-25 06:21:47 +00:00
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 emails = client.email ? client.email.split(',') : null;
const findParams = [];
if (emails.length) {
if (client.email) {
const emails = client.email.split(',');
for (let email of emails)
findParams.push({email: email});
}