mirror of
https://mau.dev/maunium/synapse.git
synced 2024-12-15 02:03:51 +01:00
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:
parent
c027a199f3
commit
0248409bfa
2 changed files with 3 additions and 2 deletions
1
changelog.d/9023.bugfix
Normal file
1
changelog.d/9023.bugfix
Normal 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.
|
|
@ -156,7 +156,7 @@ class ProfileHandler(BaseHandler):
|
||||||
except HttpResponseException as e:
|
except HttpResponseException as e:
|
||||||
raise e.to_synapse_error()
|
raise e.to_synapse_error()
|
||||||
|
|
||||||
return result["displayname"]
|
return result.get("displayname")
|
||||||
|
|
||||||
async def set_displayname(
|
async def set_displayname(
|
||||||
self,
|
self,
|
||||||
|
@ -246,7 +246,7 @@ class ProfileHandler(BaseHandler):
|
||||||
except HttpResponseException as e:
|
except HttpResponseException as e:
|
||||||
raise e.to_synapse_error()
|
raise e.to_synapse_error()
|
||||||
|
|
||||||
return result["avatar_url"]
|
return result.get("avatar_url")
|
||||||
|
|
||||||
async def set_avatar_url(
|
async def set_avatar_url(
|
||||||
self,
|
self,
|
||||||
|
|
Loading…
Reference in a new issue