From 487521b2a5644106d77d532cd6ba04ae96d3f5ce Mon Sep 17 00:00:00 2001 From: Colin-XKL Date: Sat, 23 Jan 2021 02:06:15 +0800 Subject: [PATCH] fix a problem reported by DeepScan --- lib/routes/zhihu/posts.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/routes/zhihu/posts.js b/lib/routes/zhihu/posts.js index 9c477eb5fc..8f9ef0613d 100644 --- a/lib/routes/zhihu/posts.js +++ b/lib/routes/zhihu/posts.js @@ -33,12 +33,12 @@ module.exports = async (ctx) => { link: `https://www.zhihu.com/${usertype}/${id}/posts`, description: `${authordescription}`, item: - list && + list.length>0 && list.map((item) => ({ - title: String(item.title), - description: `${item.content}`, - link: `${item.url}`, - pubDate: new Date(item.updated).toUTCString(), - })), + title: String(item.title), + description: `${item.content}`, + link: `${item.url}`, + pubDate: new Date(item.updated).toUTCString(), + })), }; };