mirror of
https://github.com/DIYgod/RSSHub.git
synced 2026-09-24 23:12:34 +08:00
fix(route/youtube/community): handle potential undefined contentText in post title (#19185)
This commit is contained in:
@@ -48,7 +48,7 @@ async function handler(ctx) {
|
||||
const post = item.backstagePostThreadRenderer.post.backstagePostRenderer || item.backstagePostThreadRenderer.post.sharedPostRenderer.originalPost.backstagePostRenderer;
|
||||
const media = post.backstageAttachment?.postMultiImageRenderer?.images.map((i) => i.backstageImageRenderer.image.thumbnails.pop()) ?? [post.backstageAttachment?.backstageImageRenderer?.image.thumbnails.pop()];
|
||||
return {
|
||||
title: post.contentText.runs[0].text,
|
||||
title: post.contentText.runs?.[0].text ?? '',
|
||||
description: art(path.join(__dirname, 'templates/community.art'), {
|
||||
runs: post.contentText.runs,
|
||||
media,
|
||||
|
||||
Reference in New Issue
Block a user