From 47edbe073745ee14b165a4adfb19588dd1569c1f Mon Sep 17 00:00:00 2001 From: Maryum Styles Date: Mon, 19 Aug 2019 18:12:23 -0400 Subject: [PATCH] PR #767 - Checks to see if the request body is nil Signed-off-by: Maryum Styles --- clientapi/routing/membership.go | 5 +++++ 1 file changed, 5 insertions(+) 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 }