diff --git a/clientapi/routing/membership.go b/clientapi/routing/membership.go index c71ac2de..351d2ca4 100644 --- a/clientapi/routing/membership.go +++ b/clientapi/routing/membership.go @@ -46,6 +46,11 @@ func SendMembership( producer *producers.RoomserverProducer, ) util.JSONResponse { var body threepid.MembershipRequest + + if req.Body == nil { + body = threepid.MembershipRequest{} + req.Body = body + } if reqErr := httputil.UnmarshalJSONRequest(req, &body); reqErr != nil { return *reqErr }