From e3b8c4f63cba78edcb7130368640217a8326df20 Mon Sep 17 00:00:00 2001 From: Thomas Sileo Date: Thu, 26 Jul 2018 23:11:38 +0200 Subject: [PATCH] Tweak threads for ghost replies --- app.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app.py b/app.py index 41dba64..a2fbd3b 100644 --- a/app.py +++ b/app.py @@ -902,7 +902,10 @@ def _build_thread(data, include_children=True): if rep_id == root_id: continue reply_of = rep["activity"]["object"]["inReplyTo"] - idx[reply_of]["_nodes"].append(rep) + try: + idx[reply_of]["_nodes"].append(rep) + except KeyError: + app.logger.info(f"{reply_of} is not there! skipping {rep}") # Flatten the tree thread = []