Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Handle a display name / avatar URL not returned via a federation request. #9023

Merged
merged 1 commit into from
Jan 6, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/9023.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix a longstanding issue where an internal server error would occur when requesting a profile over federation that did not include a display name / avatar URL.
4 changes: 2 additions & 2 deletions synapse/handlers/profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ async def get_displayname(self, target_user: UserID) -> Optional[str]:
except HttpResponseException as e:
raise e.to_synapse_error()

return result["displayname"]
return result.get("displayname")

async def set_displayname(
self,
Expand Down Expand Up @@ -246,7 +246,7 @@ async def get_avatar_url(self, target_user: UserID) -> Optional[str]:
except HttpResponseException as e:
raise e.to_synapse_error()

return result["avatar_url"]
return result.get("avatar_url")

async def set_avatar_url(
self,
Expand Down