fix(route/youtube/community): handle potential undefined contentText in post title (#19185)

This commit is contained in:
Tony
2025-05-24 20:53:36 +08:00
committed by GitHub
parent c6f3df9bda
commit 9623ddb2a1
+1 -1
View File
@@ -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,