mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-02-17 18:34:09 -05: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
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…
x
Reference in New Issue
Block a user