From a895e4a15bfc31b68afb996448be684195f04b14 Mon Sep 17 00:00:00 2001 From: David Taylor Date: Mon, 17 Aug 2020 20:53:14 +0100 Subject: [PATCH] FIX: Skip rendering twitter video if matching format not found Followup to d5a4318a --- lib/twitter_api.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/twitter_api.rb b/lib/twitter_api.rb index 8fbfced732c..a0e528219b3 100644 --- a/lib/twitter_api.rb +++ b/lib/twitter_api.rb @@ -29,7 +29,7 @@ class TwitterApi .select { |v| v['content_type'] == 'video/mp4' } .sort { |v| v['bitrate'] }.last # choose highest bitrate - if url = video_to_display['url'] + if video_to_display && url = video_to_display['url'] width = m['sizes']['large']['w'] height = m['sizes']['large']['h']