From 215537a26177558c61eb608866ce224953726f58 Mon Sep 17 00:00:00 2001 From: Krishan <33421343+kfiven@users.noreply.github.com> Date: Sun, 12 May 2024 14:36:35 +1000 Subject: [PATCH] Fix crash when img without src tag (#1731) --- src/app/utils/sanitize.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/utils/sanitize.ts b/src/app/utils/sanitize.ts index 48ab0b8..985c47b 100644 --- a/src/app/utils/sanitize.ts +++ b/src/app/utils/sanitize.ts @@ -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: {