From c3dc1342fa7f0054ec30a173d3e416a1a026015d Mon Sep 17 00:00:00 2001 From: Andvari <31068367+dzx-dzx@users.noreply.github.com> Date: Sat, 7 Oct 2023 21:59:08 +0800 Subject: [PATCH] fix(route/apnews): filter out items with no link. (#13479) --- lib/v2/apnews/topics.js | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/v2/apnews/topics.js b/lib/v2/apnews/topics.js index 1ac0d36b69..9b909a6ee7 100644 --- a/lib/v2/apnews/topics.js +++ b/lib/v2/apnews/topics.js @@ -17,6 +17,7 @@ module.exports = async (ctx) => { title: $(e).find('span.PagePromoContentIcons-text').text(), link: $(e).find('a').attr('href'), })) + .filter((e) => typeof e.link === 'string') .map((item) => ctx.cache.tryGet(item.link, async () => { const { data: response } = await got(item.link);