Skip to content

Commit 44519b3

Browse files
authored
No merge array existence check before parsing the suggestion query (#1655)
1 parent 4fe2ba0 commit 44519b3

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

backend/src/database/repositories/organizationRepository.ts

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1237,12 +1237,17 @@ class OrganizationRepository {
12371237
}
12381238
}
12391239

1240-
for (const noMergeId of organization._source.uuid_arr_noMergeIds) {
1241-
identitiesPartialQuery.must_not.push({
1242-
term: {
1243-
uuid_organizationId: noMergeId,
1244-
},
1245-
})
1240+
if (
1241+
organization._source.uuid_arr_noMergeIds &&
1242+
organization._source.uuid_arr_noMergeIds.length > 0
1243+
) {
1244+
for (const noMergeId of organization._source.uuid_arr_noMergeIds) {
1245+
identitiesPartialQuery.must_not.push({
1246+
term: {
1247+
uuid_organizationId: noMergeId,
1248+
},
1249+
})
1250+
}
12461251
}
12471252

12481253
const sameOrganizationsQueryBody = {

0 commit comments

Comments
 (0)