Check that attachment is a list

main
Bob Mottram 2023-11-29 10:48:38 +00:00
parent 3024ffaa9f
commit b43e7fc8cd
1 changed files with 2 additions and 0 deletions

View File

@ -387,6 +387,8 @@ def get_media_descriptions_from_post(post_json_object: {}) -> str:
this_post_json = post_json_object['object']
if not this_post_json.get('attachment'):
return ''
if not isinstance(this_post_json['attachment'], list):
return ''
descriptions = ''
for attach in this_post_json['attachment']:
if not isinstance(attach, dict):