From b7f6f4b7a7536d1016ce5efe9a8498728be6f3a3 Mon Sep 17 00:00:00 2001 From: bashrc Date: Tue, 5 May 2026 18:23:25 +0100 Subject: [PATCH] More checks on blog citations --- webapp_post.py | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/webapp_post.py b/webapp_post.py index d6c50cde5..fc9c6173f 100644 --- a/webapp_post.py +++ b/webapp_post.py @@ -1418,15 +1418,25 @@ def _get_blog_citations_html(box_name: str, continue if not tag_json.get('type'): continue + if not isinstance(tag_json['type'], str): + continue if tag_json['type'] != 'Article': continue if not tag_json.get('name'): continue + if not isinstance(tag_json['name'], str): + continue if not tag_json.get('url'): continue - url_str = get_url_from_post(tag_json['url']) - citation_url = remove_html(url_str) - citation_name = remove_html(tag_json['name']) + url_str: str = get_url_from_post(tag_json['url']) + if not url_str: + continue + citation_url: str = remove_html(url_str) + if not citation_url: + continue + citation_name: str = remove_html(tag_json['name']) + if not citation_name: + continue citations_str += \ '
  • ' + \ '' + citation_name + '
  • \n'