diff --git a/src/content_labels.py b/src/content_labels.py index 3b744f963..506c2e919 100644 --- a/src/content_labels.py +++ b/src/content_labels.py @@ -514,10 +514,14 @@ def _store_content_labels_base(base_dir: str, nickname: str, domain: str, map_links: list[str] = [] published = None if has_object_dict(post_json_object): - if 'content' in post_json_object['object']: + if 'content' in post_json_object['object'] and \ + 'published' 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 isinstance(published, str) and \ + isinstance(post_content, str): + 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: