From 9cfa0d32600f5198fbd9dabc601b42fad10f697a Mon Sep 17 00:00:00 2001 From: Frisk Date: Mon, 12 Oct 2020 16:57:51 +0200 Subject: [PATCH] If connection error on retrieving the forumIds for article comments pass None as it's already the case in formatters --- src/wiki.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wiki.py b/src/wiki.py index adbdf60..ae1d48c 100644 --- a/src/wiki.py +++ b/src/wiki.py @@ -231,7 +231,7 @@ async def essential_feeds(change: dict, comment_pages: dict, db_wiki: sqlite3.Ro appearance_mode = feeds_embed_formatter if target[0][1] > 0 else feeds_compact_formatter identification_string = change["_embedded"]["thread"][0]["containerType"] comment_page = None - if identification_string == "ARTICLE_COMMENT": + if identification_string == "ARTICLE_COMMENT" and comment_pages is not None: comment_page = comment_pages[change["forumId"]] comment_page["fullUrl"] = "/".join(db_wiki["wiki"].split("/", 3)[:3]) + comment_page["relativeUrl"] await appearance_mode(identification_string, change, target, db_wiki["wiki"], article_page=comment_page)