Fix crash when img without src tag (#1731)

This commit is contained in:
Krishan 2024-05-12 14:36:35 +10:00 committed by GitHub
parent ec65b98874
commit 215537a261
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -107,7 +107,7 @@ const transformATag: Transformer = (tagName, attribs) => ({
const transformImgTag: Transformer = (tagName, attribs) => {
const { src } = attribs;
if (src.startsWith('mxc://') === false) {
if (typeof src === 'string' && src.startsWith('mxc://') === false) {
return {
tagName: 'a',
attribs: {