fix(/mittrchina/breaking): TypeError: Cannot read properties of null (reading 'content') (#17855)

* feat(route): add  amz123.com

* fix(/mittrchina/breaking): check var null

TypeError: Cannot read properties of null (reading 'content')

* fix(/mittrchina): breaking url null properties
This commit is contained in:
lidashuang
2024-12-11 01:13:41 -08:00
committed by GitHub
parent c876e39f23
commit ab760e9305
+5 -3
View File
@@ -82,14 +82,16 @@ async function handler(ctx) {
type: article.address.split('.').pop(),
},
})
: article.summary,
pubDate: article.start_time ? parseDate(article.start_time, 'X') : undefined,
: type === 'breaking'
? article.content
: article.summary,
pubDate: article.start_time ? parseDate(article.start_time, 'X') : article.push_time ? parseDate(article.push_time, 'X') : undefined,
id: article.id,
link: `https://www.mittrchina.com/news/detail/${article.id}`,
}));
let items = list;
if (type !== 'video') {
if (type !== 'video' && type !== 'breaking') {
items = await Promise.all(
list.map((item) =>
cache.tryGet(item.link, async () => {