diff --git a/src/components/views/rooms/LinkPreviewWidget.tsx b/src/components/views/rooms/LinkPreviewWidget.tsx index af0b8a022e6..25d5fdd00b1 100644 --- a/src/components/views/rooms/LinkPreviewWidget.tsx +++ b/src/components/views/rooms/LinkPreviewWidget.tsx @@ -120,8 +120,9 @@ export default class LinkPreviewWidget extends React.Component { // opaque string. This does not allow any HTML to be injected into the DOM. const description = AllHtmlEntities.decode(p["og:description"] || ""); - const anchor = { p["og:title"] }; - const needsTooltip = PlatformPeg.get()?.needsUrlTooltips() && this.props.link !== p["og:title"].trim(); + const title = p["og:title"]?.trim() ?? ""; + const anchor = { title }; + const needsTooltip = PlatformPeg.get()?.needsUrlTooltips() && this.props.link !== title; return (