From 6eeb3f98950564926ab7d19d862d8f47ba847e81 Mon Sep 17 00:00:00 2001
From: chylex <contact@chylex.com>
Date: Sun, 24 Sep 2017 23:22:20 +0200
Subject: [PATCH] Fix error when hovering a quoted tweet with a video

---
 Resources/Scripts/code.js | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/Resources/Scripts/code.js b/Resources/Scripts/code.js
index 9a0a36e4..7639f0d1 100644
--- a/Resources/Scripts/code.js
+++ b/Resources/Scripts/code.js
@@ -495,8 +495,8 @@
       }
     };
     
-    var processMedia = function(media){
-      return media.filter(item => !item.isAnimatedGif).map(item => item.entity.media_url_https+":small").join(";");
+    var processMedia = function(chirp){
+      return chirp.getMedia().filter(item => !item.isAnimatedGif).map(item => item.entity.media_url_https+":small").join(";");
     };
     
     app.delegate("section.js-column", {
@@ -523,7 +523,7 @@
           let tweetUrl = tweet.getChirpURL();
           let quoteUrl = tweet.quotedTweet ? tweet.quotedTweet.getChirpURL() : "";
           let authors = tweet.quotedTweet ? [ tweet.getMainUser().screenName, tweet.quotedTweet.getMainUser().screenName ].join(";") : tweet.getMainUser().screenName;
-          let imageList = tweet.quotedTweet ? processMedia(tweet.quotedTweet.getMedia()) : tweet.hasImage() ? processMedia(tweet.getMedia()) : "";
+          let imageList = tweet.quotedTweet && tweet.quotedTweet.hasImage() ? processMedia(tweet.quotedTweet) : tweet.hasImage() ? processMedia(tweet) : "";
           
           updateHighlightedTweet(me, tweet, tweetUrl || "", quoteUrl || "", authors, imageList);
         }