Skip to content

Commit

Permalink
fix: Updates MatchReferences to handle missing link
Browse files Browse the repository at this point in the history
IF the publication is in preparation, then it wont have a DOI link. This
update checks to see if the link is missing, before attempting to create
a broken link.
  • Loading branch information
neomorphic committed Jan 18, 2024
1 parent fcd73a1 commit 7f203e7
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/components/MatchReferences.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,18 @@ export default function MatchReferences({ library, publishedName }) {

return (
<ul>
{publication.doi.map((entry) => (
{publication.doi.map((entry) => {
if (entry.link) {
return (
<li key={entry.citation}>
<a href={entry.link}>{entry.citation}</a>
</li>
))}
</li>);
}
return (
<li key={entry.citation}>
{entry.citation}
</li>);
})}
</ul>
);
}
Expand Down

0 comments on commit 7f203e7

Please sign in to comment.