mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-29 01:33:10 -06:00
Check for missing state keys to avoid panicking
This commit is contained in:
parent
b954343d73
commit
77d439dddf
|
|
@ -174,6 +174,13 @@ func SendLeave(
|
|||
}
|
||||
}
|
||||
|
||||
if event.StateKey() == nil {
|
||||
return util.JSONResponse{
|
||||
Code: http.StatusBadRequest,
|
||||
JSON: jsonerror.InvalidArgumentValue("missing state_key"),
|
||||
}
|
||||
}
|
||||
|
||||
// Check if the user has already left. If so, no-op!
|
||||
queryReq := &api.QueryLatestEventsAndStateRequest{
|
||||
RoomID: roomID,
|
||||
|
|
|
|||
Loading…
Reference in a new issue