Check for dict

main
Bob Mottram 2024-03-13 20:00:55 +00:00
parent 133185d3e9
commit 24099d5025
1 changed files with 4 additions and 3 deletions

View File

@ -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