Commit c9aac7ef authored by Raphael Beer's avatar Raphael Beer

Fix: error accessing .name field on TimelineTermination response

parent 3b3845ca
......@@ -9,7 +9,7 @@ class TimelineTermination:
async with TimelineTermination.session.get(TimelineTermination.endpoint + tweet_id) as response:
result = await response.json()
if result["name"] == "APIError" and result["errors"][0]["code"] == "ENOREPLIES":
if result.get("name", None) == "APIError" and result["errors"][0]["code"] == "ENOREPLIES":
result = None
return result
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment