fix(route/apnews): filter out items with no link. (#13479)

This commit is contained in:
Andvari
2023-10-07 21:59:08 +08:00
committed by GitHub
parent 9fdc466222
commit c3dc1342fa
+1
View File
@@ -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);