diff --git a/packages/rocketchat-ui/client/views/app/photoswipe.js b/packages/rocketchat-ui/client/views/app/photoswipe.js index 570d2b30f0ae..31f6a91c2230 100644 --- a/packages/rocketchat-ui/client/views/app/photoswipe.js +++ b/packages/rocketchat-ui/client/views/app/photoswipe.js @@ -2,7 +2,7 @@ import PhotoSwipe from 'photoswipe'; import PhotoSwipeUI_Default from 'photoswipe/dist/photoswipe-ui-default'; import 'photoswipe/dist/photoswipe.css'; -const escapeHTML = (html) => html.replace(/&/g, '&').replace(//g, '>'); +const escapeHTML = (html) => (html || '').replace(/&/g, '&').replace(//g, '>'); Meteor.startup(() => { const initGallery = (selector, items, options) => { const gallery = new PhotoSwipe(selector, PhotoSwipeUI_Default, items, options);