Skip to content

Commit

Permalink
Merge pull request #2762 from owid/fix-url-download-missing
Browse files Browse the repository at this point in the history
🔨 fix anoterh bug when rendering data page for indicator without origins
  • Loading branch information
danyx23 authored Oct 12, 2023
2 parents a218c0b + e78b05f commit 0acbf64
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion site/DataPageV2Content.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,10 @@ export const DataPageV2Content = ({
datapageData.origins[0].dateAccessed
? dayjs(datapageData.origins[0].dateAccessed).format("MMMM D, YYYY")
: ""
const urlAccessed = datapageData.origins[0].urlDownload
const urlAccessed =
datapageData.origins &&
datapageData.origins.length &&
datapageData.origins[0].urlDownload
const citationLong = `${citationShort}. ${datapageData.title}. ${originsLong}, ${processedAdapted} by Our World In Data. Retrieved ${dateAccessed} from ${urlAccessed}`
const processedAdaptedText =
datapageData.owidProcessingLevel === "minor"
Expand Down

0 comments on commit 0acbf64

Please sign in to comment.