Fix TypeError due to invalid URL (#1206)
This commit is contained in:
parent
738333efa3
commit
30718b9e1b
|
@ -244,8 +244,8 @@ export default memo(function Text ({ rel, imgproxyUrls, children, tab, itemId, o
|
||||||
paddingRight: '15px'
|
paddingRight: '15px'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
const { provider, id, meta } = parseEmbedUrl(href)
|
const { provider, id, meta } = parseEmbedUrl(href)
|
||||||
|
|
||||||
// Youtube video embed
|
// Youtube video embed
|
||||||
if (provider === 'youtube') {
|
if (provider === 'youtube') {
|
||||||
return (
|
return (
|
||||||
|
@ -275,6 +275,9 @@ export default memo(function Text ({ rel, imgproxyUrls, children, tab, itemId, o
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
} catch {
|
||||||
|
// ignore invalid URLs
|
||||||
|
}
|
||||||
|
|
||||||
// assume the link is an image which will fallback to link if it's not
|
// assume the link is an image which will fallback to link if it's not
|
||||||
return <Img src={href} rel={rel ?? UNKNOWN_LINK_REL} {...props}>{children}</Img>
|
return <Img src={href} rel={rel ?? UNKNOWN_LINK_REL} {...props}>{children}</Img>
|
||||||
|
|
Loading…
Reference in New Issue