fix(route/apnews): filter out items with no link. (#13479)
This commit is contained in:
parent
9fdc466222
commit
c3dc1342fa
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue