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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 0 deletions

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);