From d6f15e3c46b8e68b094e9801c7164b3953a8254b Mon Sep 17 00:00:00 2001 From: retoor Date: Mon, 25 Nov 2024 20:19:22 +0100 Subject: [PATCH] Bugfix for handeling receiving comments from rants having no comments. This crashed before this fix. --- src/drstats/sync.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/drstats/sync.py b/src/drstats/sync.py index 67082a7..bdc74f7 100644 --- a/src/drstats/sync.py +++ b/src/drstats/sync.py @@ -62,7 +62,7 @@ async def sync_comments(): rants_synced = 0 for rant in db["rants"].find(order_by="-id"): rants_synced += 1 - comments = dr.get_rant(rant["id"])["comments"] + comments = dr.get_rant(rant["id"]).get("comments",[]) for comment in comments: comments_synced += 1 comment["created"] = timestamp_to_string(comment["created_time"])