Changeset

4701:efdc3e4dc5df

mod_tweet_data: Return when no tweet data returned Can happen when a tweet is protected by its author.
author JC Brand <jc@opkode.com>
date Fri, 01 Oct 2021 16:58:37 +0200
parents 4700:f821eeac0e50
children 4702:7009e16192fa
files mod_tweet_data/mod_tweet_data.lua
diffstat 1 files changed, 1 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mod_tweet_data/mod_tweet_data.lua	Wed Sep 29 13:39:59 2021 +0200
+++ b/mod_tweet_data/mod_tweet_data.lua	Fri Oct 01 16:58:37 2021 +0200
@@ -25,6 +25,7 @@
 
 			local response = json.decode(response_body);
 			if not response then return; end
+			if not response['data'] or not response['includes'] then return; end
 
 			local tweet = response['data'];
 			local author = response['includes']['users'][1];