From 4a7d0f4d43f3ef0502d214b2ebf1cb1ad6de54ec Mon Sep 17 00:00:00 2001 From: Tony Date: Tue, 31 May 2022 12:37:23 +0000 Subject: [PATCH] fix(route): orcid null journalTitle fix https://github.com/DIYgod/RSSHub/issues/9170#issuecomment-1137797867 --- lib/v2/orcid/index.js | 2 +- lib/v2/orcid/templates/description.art | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/v2/orcid/index.js b/lib/v2/orcid/index.js index bcca5d882..674d28978 100644 --- a/lib/v2/orcid/index.js +++ b/lib/v2/orcid/index.js @@ -34,7 +34,7 @@ module.exports = async (ctx) => { link: work.url, description: art(path.join(__dirname, 'templates/description.art'), { title: work.title.value, - journalTitle: work.journalTitle.value, + journalTitle: work.journalTitle?.value, publicationDate: work.publicationDate, workType: work.workType.value, Str, diff --git a/lib/v2/orcid/templates/description.art b/lib/v2/orcid/templates/description.art index 2e36ecca4..8f6970f4d 100644 --- a/lib/v2/orcid/templates/description.art +++ b/lib/v2/orcid/templates/description.art @@ -1,3 +1,3 @@ -

{{ title }}

{{ journalTitle }}

+

{{ title }}

{{ if journalTitle }}

{{ journalTitle }}

{{ /if }} {{ if publicationDate.year }}{{ publicationDate.year }}{{ /if }}{{ if publicationDate.month }}-{{ publicationDate.month }}{{ /if }}{{ if publicationDate.day }}-{{ publicationDate.day }}{{ /if }} | {{ workType }}
-{{@ Str }}Source: {{ sourceName }} \ No newline at end of file +{{@ Str }}Source: {{ sourceName }}