From e78b05fb59a32a2d288bd179e2e2cab4b86049c8 Mon Sep 17 00:00:00 2001 From: Daniel Bachler Date: Thu, 12 Oct 2023 23:06:32 +0200 Subject: [PATCH] :hammer: fix another use that fails --- site/DataPageV2Content.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/site/DataPageV2Content.tsx b/site/DataPageV2Content.tsx index db0fce8402f..94c70f3114e 100644 --- a/site/DataPageV2Content.tsx +++ b/site/DataPageV2Content.tsx @@ -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"