Skip to content

Commit

Permalink
Fix crash when img without src tag (#1731)
Browse files Browse the repository at this point in the history
  • Loading branch information
kfiven authored May 12, 2024
1 parent ec65b98 commit 215537a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/app/utils/sanitize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down

0 comments on commit 215537a

Please sign in to comment.