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

Commit

Permalink
Remove redundant length check
Browse files Browse the repository at this point in the history
> if `len(auth_event_ids) == 0` then `auth_event_ids` will be falsey, so the extra check is redundant.
>
> -- #11243 (comment)
  • Loading branch information
MadLittleMods committed Nov 9, 2021
1 parent d10625e commit 2370dca
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion synapse/handlers/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -961,7 +961,7 @@ async def create_new_client_event(
or len(prev_event_ids) > 0
# Allow an event to have empty list of prev_event_ids
# only if it has auth_event_ids.
or (auth_event_ids and len(auth_event_ids) > 0)
or auth_event_ids
), "Attempting to create a non-m.room.create event with no prev_events or auth_event_ids"
else:
# we now ought to have some prev_events (unless it's a create event).
Expand Down

0 comments on commit 2370dca

Please sign in to comment.