From e854138dcecc223fac1038704ec0d9266037217b Mon Sep 17 00:00:00 2001 From: Harmon Date: Mon, 30 Jan 2023 12:49:11 -0600 Subject: [PATCH] Handle empty payloads in JSONParser.parse Resolves #2051 --- tweepy/parsers.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tweepy/parsers.py b/tweepy/parsers.py index a6ca97d..2aee1a5 100644 --- a/tweepy/parsers.py +++ b/tweepy/parsers.py @@ -33,6 +33,9 @@ class JSONParser(Parser): payload_format = 'json' def parse(self, payload, *, return_cursors=False, **kwargs): + if not payload: + return + try: json = json_lib.loads(payload) except Exception as e: -- 2.25.1