From a8fbe10835b95ed0a105d725938e4d2171639407 Mon Sep 17 00:00:00 2001 From: Igor Richter Date: Mon, 25 Sep 2023 16:57:49 +0200 Subject: [PATCH] fix empty ldapDns WIP --- src/services/sync/strategies/consumerActions/ClassAction.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/services/sync/strategies/consumerActions/ClassAction.js b/src/services/sync/strategies/consumerActions/ClassAction.js index 3bf1b1329f6..151281b0407 100644 --- a/src/services/sync/strategies/consumerActions/ClassAction.js +++ b/src/services/sync/strategies/consumerActions/ClassAction.js @@ -90,7 +90,10 @@ class ClassAction extends BaseConsumerAction { const teachers = []; const ldapDns = !Array.isArray(uniqueMembers) ? [uniqueMembers] : uniqueMembers; - const users = await UserRepo.findByLdapDnsAndSchool(ldapDns, schoolId); + let users = []; + if (ldapDns) { + const users = await UserRepo.findByLdapDnsAndSchool(ldapDns, schoolId); + } users.forEach((user) => { user.roles.forEach((role) => {