summary refs log tree commit diff
path: root/synapse
diff options
context:
space:
mode:
authorRichard van der Hoff <richard@matrix.org>2015-10-26 18:32:49 +0000
committerRichard van der Hoff <richard@matrix.org>2015-10-26 18:44:03 +0000
commitf69a5c9134a3e4bba929dc76d561d9cc42cadeac (patch)
tree24915683079b7031654130f3aa1985f84b5b6a7f /synapse
parentMerge pull request #328 from matrix-org/erikj/search (diff)
downloadsynapse-f69a5c9134a3e4bba929dc76d561d9cc42cadeac.tar.xz
Fix a 500 error resulting from empty room_ids
POST /_matrix/client/api/v1/rooms//send/a.b.c gave a 500 error, because we
assumed that rooms always had at least one character.
Diffstat (limited to 'synapse')
-rw-r--r--synapse/types.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/synapse/types.py b/synapse/types.py
index 9cffc33d27..8c51e00e8a 100644
--- a/synapse/types.py
+++ b/synapse/types.py
@@ -47,7 +47,7 @@ class DomainSpecificString(
     @classmethod
     def from_string(cls, s):
         """Parse the string given by 's' into a structure object."""
-        if s[0] != cls.SIGIL:
+        if len(s) < 1 or s[0] != cls.SIGIL:
             raise SynapseError(400, "Expected %s string to start with '%s'" % (
                 cls.__name__, cls.SIGIL,
             ))