Skip to content

Commit 917efd3

Browse files
authored
Merging existing tags error when data.tags is not present (#1784)
1 parent 3be0d38 commit 917efd3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

backend/src/database/repositories/organizationRepository.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,8 @@ class OrganizationRepository {
341341
const existingOrg = existingOrgs.find((o) => o.id === org.id)
342342
if (existingOrg && existingOrg.tags) {
343343
// Merge existing and new tags without duplicates
344-
org.tags = lodash.uniq([...existingOrg.tags, ...org.tags])
344+
const incomingTags = org.tags || []
345+
org.tags = lodash.uniq([...existingOrg.tags, ...incomingTags])
345346
}
346347
return org
347348
})

0 commit comments

Comments
 (0)