Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Ensure that event.redacts exists before handling it as a string #8457

Merged
merged 2 commits into from
Oct 5, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/8457.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix a bug where backfilling a room with an event that was missing the `redacts` field would break.
2 changes: 2 additions & 0 deletions synapse/event_auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down