diff --git a/twoot.py b/twoot.py index 8dfab80..624780c 100755 --- a/twoot.py +++ b/twoot.py @@ -256,7 +256,10 @@ def update_profile(nitter_url, soup, sql, mast_password): # Update profile on Mastodon # media.content, mime_type=media.headers['content-type'] try: - mastodon.account_update_credentials(avatar=new_avatar_img, avatar_mime_type=new_avatar_mime, header=new_banner_img, header_mime_type=new_banner_mime) + if new_avatar_img is not None: + mastodon.account_update_credentials(avatar=new_avatar_img, avatar_mime_type=new_avatar_mime) + if new_banner_img is not None: + mastodon.account_update_credentials(header=new_banner_img, header_mime_type=new_banner_mime) except Exception as e: logging.error("Could not update profile") logging.error(e)