From b0d8da58d8359acc44e594caf1ce819872415abe Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Mon, 31 Jul 2023 13:13:14 +0100 Subject: [PATCH] Check that inReplyTo Exists --- webapp_post.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/webapp_post.py b/webapp_post.py index d116dcfbb..1b42803b7 100644 --- a/webapp_post.py +++ b/webapp_post.py @@ -1556,11 +1556,14 @@ def _get_post_title_reply_html(base_dir: str, return (title_str, reply_avatar_image_in_post, container_class_icons, container_class) - in_reply_to = obj_json['inReplyTo'] - if not reply_actor: + in_reply_to = None + if obj_json.get('inReplyTo'): + if isinstance(obj_json['inReplyTo'], str): + in_reply_to = obj_json['inReplyTo'] + if in_reply_to and not reply_actor: reply_actor = in_reply_to.split('/statuses/')[0] reply_nickname = get_nickname_from_actor(reply_actor) - if not reply_nickname: + if not reply_nickname or not in_reply_to: title_str += \ _reply_to_unknown_html(translate, post_json_object, nickname) return (title_str, reply_avatar_image_in_post,