mirror of
https://github.com/element-hq/synapse.git
synced 2024-11-29 15:39:00 +03:00
Ensure that event.redacts is the proper type before handling it (#8457)
This fixes a bug when backfilling invalid events.
This commit is contained in:
parent
0991a2da93
commit
da11cc22be
2 changed files with 3 additions and 0 deletions
1
changelog.d/8457.bugfix
Normal file
1
changelog.d/8457.bugfix
Normal file
|
@ -0,0 +1 @@
|
|||
Fix a bug where backfilling a room with an event that was missing the `redacts` field would break.
|
|
@ -446,6 +446,8 @@ def check_redaction(
|
|||
|
||||
if room_version_obj.event_format == EventFormatVersions.V1:
|
||||
redacter_domain = get_domain_from_id(event.event_id)
|
||||
if not isinstance(event.redacts, str):
|
||||
return False
|
||||
redactee_domain = get_domain_from_id(event.redacts)
|
||||
if redacter_domain == redactee_domain:
|
||||
return True
|
||||
|
|
Loading…
Reference in a new issue