Handle a display name / avatar URL not included in a federation request. (#9023)

These may be omitted if not set, but Synapse assumed they would
be in the response.
This commit is contained in:
Patrick Cloke 2021-01-06 07:29:03 -05:00 committed by GitHub
parent c027a199f3
commit 0248409bfa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

1
changelog.d/9023.bugfix Normal file
View File

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

View File

@ -156,7 +156,7 @@ class ProfileHandler(BaseHandler):
except HttpResponseException as e:
raise e.to_synapse_error()
return result["displayname"]
return result.get("displayname")
async def set_displayname(
self,
@ -246,7 +246,7 @@ class ProfileHandler(BaseHandler):
except HttpResponseException as e:
raise e.to_synapse_error()
return result["avatar_url"]
return result.get("avatar_url")
async def set_avatar_url(
self,