Mercurial > prosody-modules
diff mod_tweet_data/mod_tweet_data.lua @ 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 | c858c76d0845 |
children |
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];