Skip to content

Commit 30681a1

Browse files
committed
fix: guard linkedin handle before creating identity (CM-1354)
Signed-off-by: Yeganathan S <63534555+skwowet@users.noreply.github.com>
1 parent 6bdca30 commit 30681a1

1 file changed

Lines changed: 11 additions & 8 deletions

File tree

  • services/apps/members_enrichment_worker/src/sources/crustdata

services/apps/members_enrichment_worker/src/sources/crustdata/service.ts

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -338,14 +338,17 @@ export default class EnrichmentServiceCrustdata extends LoggerBase implements IE
338338

339339
const linkedinUrl = data.social_handles?.professional_network_identifier?.profile_url
340340
if (linkedinUrl) {
341-
normalized = normalizeSocialIdentity(
342-
{
343-
handle: linkedinUrl.split('/').filter(Boolean).pop(),
344-
platform: PlatformType.LINKEDIN,
345-
},
346-
MemberIdentityType.USERNAME,
347-
normalized,
348-
)
341+
const handle = linkedinUrl.split('/').filter(Boolean).pop()
342+
if (handle) {
343+
normalized = normalizeSocialIdentity(
344+
{
345+
handle,
346+
platform: PlatformType.LINKEDIN,
347+
},
348+
MemberIdentityType.USERNAME,
349+
normalized,
350+
)
351+
}
349352
}
350353

351354
const githubUrl = data.social_handles?.dev_platform_identifier?.profile_url

0 commit comments

Comments
 (0)