mirror of
https://github.com/hoernschen/dendrite.git
synced 2024-12-26 15:08:28 +00:00
PR #767 - Checks to see if the request body is nil
Signed-off-by: Maryum Styles <yozamacs@msn.com>
This commit is contained in:
parent
7b454bdd27
commit
47edbe0737
1 changed files with 5 additions and 0 deletions
|
@ -46,6 +46,11 @@ func SendMembership(
|
||||||
producer *producers.RoomserverProducer,
|
producer *producers.RoomserverProducer,
|
||||||
) util.JSONResponse {
|
) util.JSONResponse {
|
||||||
var body threepid.MembershipRequest
|
var body threepid.MembershipRequest
|
||||||
|
|
||||||
|
if req.Body == nil {
|
||||||
|
body = threepid.MembershipRequest{}
|
||||||
|
req.Body = body
|
||||||
|
}
|
||||||
if reqErr := httputil.UnmarshalJSONRequest(req, &body); reqErr != nil {
|
if reqErr := httputil.UnmarshalJSONRequest(req, &body); reqErr != nil {
|
||||||
return *reqErr
|
return *reqErr
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue