Skip to content

Commit

Permalink
Check in case affiliation does not have identifier field (#2411)
Browse files Browse the repository at this point in the history
  • Loading branch information
futa-ikeda authored Nov 21, 2024
1 parent df01773 commit 15ba724
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,14 @@ function hasInstitutionAffiliation(contributors: any[], attribution: any, instit
}

return attributedContributor.affiliation.some(
(affiliation: any) => affiliation.identifier.some(
(affiliationIdentifier: any) => institutionIris.includes(affiliationIdentifier['@value']),
),
(affiliation: any) => {
if (affiliation.identifier) {
return affiliation.identifier.some(
(affiliationIdentifier: any) => institutionIris.includes(affiliationIdentifier['@value']),
);
}
return institutionIris.includes(affiliation['@id']);
},
);
}

Expand Down

0 comments on commit 15ba724

Please sign in to comment.