Check that attachment is a dict

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

View File

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