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

Commit

Permalink
Handle event.redacts being None.
Browse files Browse the repository at this point in the history
  • Loading branch information
clokep committed Oct 2, 2020
1 parent e3debf9 commit cfb32b2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
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.
4 changes: 3 additions & 1 deletion synapse/event_auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,9 @@ def check_redaction(

if room_version_obj.event_format == EventFormatVersions.V1:
redacter_domain = get_domain_from_id(event.event_id)
redactee_domain = get_domain_from_id(event.redacts)
redactee_domain = None
if event.redacts:
redactee_domain = get_domain_from_id(event.redacts)
if redacter_domain == redactee_domain:
return True
else:
Expand Down

0 comments on commit cfb32b2

Please sign in to comment.