Check that inReplyTo is a string

merge-requests/30/head
Bob Mottram 2024-11-27 15:31:10 +00:00
parent 85662592db
commit 672e2d1edb
1 changed files with 8 additions and 0 deletions

View File

@ -4980,8 +4980,16 @@ def get_reply_to(post_json_object: {}) -> str:
"""Returns the reply to link from a post
"""
if post_json_object.get('inReplyTo'):
if not isinstance(post_json_object['inReplyTo'], str):
print('WARN: inReplyTo is not a string ' +
str(post_json_object['inReplyTo']))
return ''
return post_json_object['inReplyTo']
if post_json_object.get('inReplyToBook'):
if not isinstance(post_json_object['inReplyToBook'], str):
print('WARN: inReplyToBook is not a string ' +
str(post_json_object['inReplyToBook']))
return ''
return post_json_object['inReplyToBook']
return ''