diff --git a/app/components/post_body_additional_content/post_body_additional_content.js b/app/components/post_body_additional_content/post_body_additional_content.js index 6143bbe0c..e104b4306 100644 --- a/app/components/post_body_additional_content/post_body_additional_content.js +++ b/app/components/post_body_additional_content/post_body_additional_content.js @@ -391,7 +391,16 @@ export default class PostBodyAdditionalContent extends ImageViewPort { getViewPortWidth(this.props.isReplyPost, this.hasPermanentSidebar()), ); - const imgUrl = Object.keys(this.props.metadata.images)[0] || `https://i.ytimg.com/vi/${videoId}/hqdefault.jpg`; + let imgUrl; + if (this.props.metadata?.images) { + imgUrl = Object.keys(this.props.metadata.images)[0]; + } + + if (!imgUrl) { + // Fallback to default YouTube thumbnail if available + imgUrl = `https://i.ytimg.com/vi/${videoId}/hqdefault.jpg`; + } + return (