mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-02 22:14:55 -04:00
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.
This commit is contained in:
parent
3f0a57eb9b
commit
f69a5c9134
2 changed files with 8 additions and 3 deletions
|
@ -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,
|
||||
))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue