From 57d0860fd914a5d0089fad43ce8a46d2251185cb Mon Sep 17 00:00:00 2001 From: hoilc Date: Sun, 8 Dec 2019 02:41:47 +0800 Subject: [PATCH] fix: natgeo null author (#3548) --- lib/routes/natgeo/dailyphoto.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/routes/natgeo/dailyphoto.js b/lib/routes/natgeo/dailyphoto.js index 91b4b571f..8e6c1695d 100644 --- a/lib/routes/natgeo/dailyphoto.js +++ b/lib/routes/natgeo/dailyphoto.js @@ -12,7 +12,7 @@ module.exports = async (ctx) => { const out = items.slice(0, 10).map((item) => { const info = { title: item.image.title, - author: item.image.credit.replace('Photograph by ', ''), + author: item.image.credit && item.image.credit.replace('Photograph by ', ''), link: item.pageUrl, description: `` + item.image.caption, };