Skip to content

Commit

Permalink
Guard against missing doi formats
Browse files Browse the repository at this point in the history
  • Loading branch information
Tammo-Feldmann committed Aug 23, 2023
1 parent cefe8c3 commit 1d32c36
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/data-section.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const DataSection = ({ id, dois, filterBy, category }) => {
)
const formatList = parsedDois.reduce(
(acc, doi) => {
if (doi.formats.length > 0) {
if (doi.formats && doi.formats.length > 0) {
for (const format of doi.formats) {
if (!acc.unique.has(format.id)) {
acc.unique.add(format.id)
Expand Down

0 comments on commit 1d32c36

Please sign in to comment.