From 16a4e0edd130dd03fa1a4c6008132c7491fafe58 Mon Sep 17 00:00:00 2001 From: Bastien Seree Date: Fri, 13 Sep 2024 11:13:56 +0200 Subject: [PATCH] Cyberleague: [#116] Fix one field test in related_users computing --- backend/web/server/plugins/cyberleague/related.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/web/server/plugins/cyberleague/related.js b/backend/web/server/plugins/cyberleague/related.js index ca4ead56a4..7b9dc2533a 100644 --- a/backend/web/server/plugins/cyberleague/related.js +++ b/backend/web/server/plugins/cyberleague/related.js @@ -23,7 +23,7 @@ const getRelated = (model) => { let res = [] const sameUserFunction = lodash.groupBy(users, (u) => u.function)[data.function] - const sameFunLength = sameUserFunction.length || 0 + const sameFunLength = sameUserFunction?.length || 0 //if not enough related with same function, need to add users with same company size if (sameFunLength <10) {