From aabd319d3d255ea45f5cc7aa8f8b2e9668a4b593 Mon Sep 17 00:00:00 2001 From: bashrc Date: Sun, 23 Aug 2026 23:45:37 +0100 Subject: [PATCH] Check that fields are strings --- src/content_labels.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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: