Skip to content

Commit ab760e9

Browse files
authored
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
1 parent c876e39 commit ab760e9

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

lib/routes/mittrchina/index.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,14 +82,16 @@ async function handler(ctx) {
8282
type: article.address.split('.').pop(),
8383
},
8484
})
85-
: article.summary,
86-
pubDate: article.start_time ? parseDate(article.start_time, 'X') : undefined,
85+
: type === 'breaking'
86+
? article.content
87+
: article.summary,
88+
pubDate: article.start_time ? parseDate(article.start_time, 'X') : article.push_time ? parseDate(article.push_time, 'X') : undefined,
8789
id: article.id,
8890
link: `https://www.mittrchina.com/news/detail/${article.id}`,
8991
}));
9092

9193
let items = list;
92-
if (type !== 'video') {
94+
if (type !== 'video' && type !== 'breaking') {
9395
items = await Promise.all(
9496
list.map((item) =>
9597
cache.tryGet(item.link, async () => {

0 commit comments

Comments
 (0)