mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-06 12:45:03 -04:00
Fix errors when updating the user directory with invalid data (#8223)
This commit is contained in:
parent
b5133dd97f
commit
b939251c37
4 changed files with 19 additions and 1 deletions
|
@ -371,6 +371,11 @@ class UserDirectoryBackgroundUpdateStore(StateDeltasStore):
|
|||
"""
|
||||
Update or add a user's profile in the user directory.
|
||||
"""
|
||||
# If the display name or avatar URL are unexpected types, overwrite them.
|
||||
if not isinstance(display_name, str):
|
||||
display_name = None
|
||||
if not isinstance(avatar_url, str):
|
||||
avatar_url = None
|
||||
|
||||
def _update_profile_in_user_dir_txn(txn):
|
||||
new_entry = self.db_pool.simple_upsert_txn(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue