mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-16 19:33:09 -06:00
Add nil check for queryEventsRes.StateEvents
This commit is contained in:
parent
9bdb36c0aa
commit
0049b4502f
|
|
@ -88,7 +88,7 @@ func SetVisibility(
|
|||
}
|
||||
var queryEventsRes api.QueryLatestEventsAndStateResponse
|
||||
err = queryAPI.QueryLatestEventsAndState(req.Context(), &queryEventsReq, &queryEventsRes)
|
||||
if err != nil {
|
||||
if err != nil || len(queryEventsRes.StateEvents) == 0 {
|
||||
util.GetLogger(req.Context()).WithError(err).Error("could not query events from room")
|
||||
return jsonerror.InternalServerError()
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue