fix(latepost): TypeError: Cannot read properties of undefined (reading 'title') (#17759)

TypeError: Cannot read properties of undefined (reading 'title')
This commit is contained in:
lidashuang
2024-11-30 23:37:27 +08:00
committed by GitHub
parent 6f551949ea
commit 5cd2382057
+1 -1
View File
@@ -72,7 +72,7 @@ async function handler(ctx) {
let items = response.data.slice(0, limit).map((item) => ({
title: item.title,
link: new URL(item.detail_url, rootUrl).href,
category: [item.is_dj ? exclusiveCategory : undefined, item.programa ? columns[item.programa].title : undefined, ...item.label.map((c) => c.label)],
category: [item.is_dj ? exclusiveCategory : undefined, item.programa ? columns[item.programa]?.title : undefined, ...item.label.map((c) => c.label)],
guid: item.id,
pubDate: parseDate(item.release_time, ['MM月DD日', 'YYYY年MM月DD日']),
}));