Skip to content

Commit

Permalink
error checking
Browse files Browse the repository at this point in the history
  • Loading branch information
shinyichen committed Dec 13, 2024
1 parent 06dcdc9 commit 5165644
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/components/ResultList/SimpleResultList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,14 @@ export const SimpleResultList = (props: ISimpleResultListProps): ReactElement =>
// a map from bibcode to citation
const defaultCitations = useMemo(() => {
const citationSet = new Map<string, string>();
if (!!citationData) {
citationData.export.split('\n').forEach((c, index) => {
citationSet.set(bibcodes[index], c);
});
try {
if (!!citationData) {
citationData.export.split('\n').forEach((c, index) => {
citationSet.set(bibcodes[index], c);
});
}
} catch {
defaultCitations.clear();
}
return citationSet;
}, [citationData]);
Expand Down

0 comments on commit 5165644

Please sign in to comment.