Skip to content

best way to save what you love

twitter: handle no media properly

wukko2cb99880d62c
diff --git a/src/modules/processing/services/twitter.js b/src/modules/processing/services/twitter.js
index 7e01fab4..94b55eb1 100644
--- a/src/modules/processing/services/twitter.js
+++ b/src/modules/processing/services/twitter.js
@@ -104,7 +104,7 @@ export default async function({ id, index, toGif }) {
const baseTweet = tweet.data.tweetResult.result.legacy,
repostedTweet = baseTweet.retweeted_status_result?.result.legacy.extended_entities;
- let media = (repostedTweet?.media || baseTweet.extended_entities.media);
+ let media = (repostedTweet?.media || baseTweet?.extended_entities?.media);
media = media?.filter(m => m.video_info?.variants?.length);
// check if there's a video at given index (/video/<index>)