From 24099d5025fd27a661b7c7f04e78362af3aa2d4a Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Wed, 13 Mar 2024 20:00:55 +0000 Subject: [PATCH] Check for dict --- webapp_profile.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/webapp_profile.py b/webapp_profile.py index addd4cc2a..b68a4fb6c 100644 --- a/webapp_profile.py +++ b/webapp_profile.py @@ -278,9 +278,10 @@ def html_profile_after_search(authorized: bool, avatar_url = '' if profile_json.get('icon'): - if profile_json['icon'].get('url'): - url_str = get_url_from_post(profile_json['icon']['url']) - avatar_url = remove_html(url_str) + if isinstance(profile_json['icon'], dict): + if profile_json['icon'].get('url'): + url_str = get_url_from_post(profile_json['icon']['url']) + avatar_url = remove_html(url_str) if not avatar_url: avatar_url = get_person_avatar_url(base_dir, person_url, person_cache) display_name = search_nickname