Browse Source

Bugfix. URL is passed in, not object

JC Brand 3 years ago
parent
commit
1104b28758
1 changed files with 2 additions and 2 deletions
  1. 2 2
      src/shared/chat/templates/unfurl.js

+ 2 - 2
src/shared/chat/templates/unfurl.js

@@ -12,8 +12,8 @@ function isValidImage (image) {
     return image && isDomainAllowed(image, 'allowed_image_domains') && isValidURL(image);
 }
 
-function shouldHideMediaURL (o) {
-    return isGIFURL(o.url) || isVideoURL(o.url) || isAudioURL(o.url);
+function shouldHideMediaURL (url) {
+    return url && (isGIFURL(url) || isVideoURL(url) || isAudioURL(url));
 }
 
 const tpl_url_wrapper = (o, wrapped_template) =>