From 76cb734e5475bdbab3205e0993f87905ccb5ec51 Mon Sep 17 00:00:00 2001 From: Cloud Date: Sun, 28 Jul 2019 19:11:22 +0800 Subject: [PATCH] fix: banyuetan null error (#2708) --- lib/routes/banyuetan/index.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/routes/banyuetan/index.js b/lib/routes/banyuetan/index.js index f410d68fa..bd1ae0a39 100644 --- a/lib/routes/banyuetan/index.js +++ b/lib/routes/banyuetan/index.js @@ -41,9 +41,7 @@ module.exports = async (ctx) => { const response = await got.get(itemUrl); const $ = cheerio.load(response.data); - const description = $('div.detail_content') - .html() - .trim(); + const description = $('div.detail_content').html() || '文章已被删除'; const single = { title: title,