fix(route/youtube/community): handle potential undefined contentText in post title (#19185)
This commit is contained in:
parent
c6f3df9bda
commit
9623ddb2a1
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Reference in New Issue