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
|
@ -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 New Issue