瀏覽代碼

Bugfix. URL is passed in, not object

JC Brand 3 年之前
父節點
當前提交
1104b28758
共有 1 個文件被更改,包括 2 次插入2 次删除
  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) =>