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.pull/9030/head
parent
c027a199f3
commit
0248409bfa
|
@ -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 New Issue