diff --git a/synapse/types.py b/synapse/types.py index 7b6ae44bddc8..f639651a7307 100644 --- a/synapse/types.py +++ b/synapse/types.py @@ -22,7 +22,10 @@ def get_domain_from_id(string): - return string.split(":", 1)[1] + try: + return string.split(":", 1)[1] + except IndexError: + raise SynapseError(400, "Invalid ID: %r", string) class DomainSpecificString(