From 4751d96a1d3bbdbd645ea3306343379db53baa13 Mon Sep 17 00:00:00 2001 From: Timothy Quilling Date: Fri, 30 Jun 2023 00:18:39 -0400 Subject: [PATCH] chore: check none type --- find_posts.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/find_posts.py b/find_posts.py index 04c2255..dffe86f 100644 --- a/find_posts.py +++ b/find_posts.py @@ -396,7 +396,10 @@ def get_all_known_context_urls(server, reply_toots, parsed_urls): url = toot["url"] if toot["reblog"] is None else toot["reblog"]["url"] parsed_url = parse_url(url, parsed_urls) context = get_toot_context(parsed_url[0], parsed_url[1], url) - known_context_urls.update(context) # type: ignore + if context is not None: + known_context_urls.update(context) # type: ignore + else: + log(f"Error getting context for toot {url}") known_context_urls = set(filter(lambda url: not url.startswith(f"https://{server}/"), known_context_urls)) log(f"Found {len(known_context_urls)} known context toots")