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
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

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,