From 3024ffaa9f749bd18a93e2cfb88ccdb23eef8e42 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Wed, 29 Nov 2023 10:45:39 +0000 Subject: [PATCH] Check that attachment is a dict --- utils.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/utils.py b/utils.py index 9814f6fbb..295d87c0f 100644 --- a/utils.py +++ b/utils.py @@ -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'] + ' '