From 1088f5c30a4383ed21dc4dd27d4253a81470422f Mon Sep 17 00:00:00 2001 From: Isaac Date: Sun, 19 May 2024 20:20:20 +0100 Subject: [PATCH] fix: quote author undefined error --- src/features/quote/Quote.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/features/quote/Quote.jsx b/src/features/quote/Quote.jsx index 00d80ae0..1b6df024 100644 --- a/src/features/quote/Quote.jsx +++ b/src/features/quote/Quote.jsx @@ -151,7 +151,7 @@ class Quote extends PureComponent { ).json(); const authorImagePage = authorimglicensedata.query.pages[Object.keys(authorimglicensedata.query.pages)[0]]; - const metadata = authorImagePage?.imageinfo[0]?.extmetadata; + const metadata = authorImagePage?.imageinfo?.[0]?.extmetadata; const license = metadata?.LicenseShortName; const photographer = this.stripHTML(metadata.Attribution?.value || metadata.Artist?.value || '').replace(/ \(talk\)/, '') || // talk page link (if applicable) is only removed for English