fix: natgeo null author (#3548)

This commit is contained in:
hoilc 2019-12-08 02:41:47 +08:00 committed by DIYgod
parent aeb111cfe0
commit 57d0860fd9
1 changed files with 1 additions and 1 deletions

View File

@ -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: `<img src="${item.image.uri}">` + item.image.caption,
};