chore: check none type
This commit is contained in:
parent
4011883ef2
commit
4751d96a1d
1 changed files with 4 additions and 1 deletions
|
@ -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"]
|
url = toot["url"] if toot["reblog"] is None else toot["reblog"]["url"]
|
||||||
parsed_url = parse_url(url, parsed_urls)
|
parsed_url = parse_url(url, parsed_urls)
|
||||||
context = get_toot_context(parsed_url[0], parsed_url[1], url)
|
context = get_toot_context(parsed_url[0], parsed_url[1], url)
|
||||||
|
if context is not None:
|
||||||
known_context_urls.update(context) # type: ignore
|
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))
|
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")
|
log(f"Found {len(known_context_urls)} known context toots")
|
||||||
|
|
Loading…
Reference in a new issue