Check that icon is a dict

main
Bob Mottram 2025-02-04 10:07:44 +00:00
parent 268d63991d
commit cae87ac553
1 changed files with 8 additions and 4 deletions

View File

@ -1995,10 +1995,14 @@ def get_person_avatar_url(base_dir: str, person_url: str,
return im_path return im_path
if person_json.get('icon'): if person_json.get('icon'):
if person_json['icon'].get('url'): if isinstance(person_json['icon'], dict):
url_str = get_url_from_post(person_json['icon']['url']) if person_json['icon'].get('url'):
if '.svg' not in url_str.lower(): url_str = get_url_from_post(person_json['icon']['url'])
return remove_html(url_str) if '.svg' not in url_str.lower():
return remove_html(url_str)
else:
print('DEBUG: get_person_avatar_url icon is not a dict ' +
str(person_json['icon']))
return None return None