From 88501572deb55e48c299a803656d638481a0745d Mon Sep 17 00:00:00 2001 From: bashrc Date: Sun, 23 Aug 2026 23:41:09 +0100 Subject: [PATCH] Check object is dict --- src/content_labels.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/content_labels.py b/src/content_labels.py index 10527a2c9..3b744f963 100644 --- a/src/content_labels.py +++ b/src/content_labels.py @@ -513,10 +513,11 @@ def _store_content_labels_base(base_dir: str, nickname: str, domain: str, # get geolocations from content map_links: list[str] = [] published = None - if 'content' in post_json_object['object']: - published = post_json_object['object']['published'] - post_content = post_json_object['object']['content'] - map_links += get_map_links_from_post_content(post_content, session) + if has_object_dict(post_json_object): + if 'content' in post_json_object['object']: + published = post_json_object['object']['published'] + post_content = post_json_object['object']['content'] + map_links += get_map_links_from_post_content(post_content, session) # get geolocation from labels location_str = get_location_from_post(post_json_object) if location_str: