diff --git a/src/github.com/matrix-org/dendrite/clientapi/readers/register.go b/src/github.com/matrix-org/dendrite/clientapi/readers/register.go index 845b97722..7d1b035dd 100644 --- a/src/github.com/matrix-org/dendrite/clientapi/readers/register.go +++ b/src/github.com/matrix-org/dendrite/clientapi/readers/register.go @@ -45,6 +45,13 @@ func RegisterAvailable( ) util.JSONResponse { username := req.URL.Query().Get("username") + if username == "" { + return util.JSONResponse{ + Code: 400, + JSON: jsonerror.InvalidUsername("Missing query parameter"), + } + } + if resErr := validate(username); resErr != nil { return *resErr }