Skip to content
Snippets Groups Projects
Unverified Commit da11cc22 authored by Patrick Cloke's avatar Patrick Cloke Committed by GitHub
Browse files

Ensure that event.redacts is the proper type before handling it (#8457)

This fixes a bug when backfilling invalid events.
parent 0991a2da
No related branches found
No related tags found
No related merge requests found
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( ...@@ -446,6 +446,8 @@ def check_redaction(
if room_version_obj.event_format == EventFormatVersions.V1: if room_version_obj.event_format == EventFormatVersions.V1:
redacter_domain = get_domain_from_id(event.event_id) 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) redactee_domain = get_domain_from_id(event.redacts)
if redacter_domain == redactee_domain: if redacter_domain == redactee_domain:
return True return True
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment