Don't send null in joined_rooms response

This commit is contained in:
Neil Alexander 2020-12-18 12:33:36 +00:00
parent 50963b724b
commit b4dae18c50
No known key found for this signature in database
GPG key ID: A02A2019A2BB0944

View file

@ -111,6 +111,9 @@ func GetJoinedRooms(
util.GetLogger(req.Context()).WithError(err).Error("QueryRoomsForUser failed") util.GetLogger(req.Context()).WithError(err).Error("QueryRoomsForUser failed")
return jsonerror.InternalServerError() return jsonerror.InternalServerError()
} }
if res.RoomIDs == nil {
res.RoomIDs = []string{}
}
return util.JSONResponse{ return util.JSONResponse{
Code: http.StatusOK, Code: http.StatusOK,
JSON: getJoinedRoomsResponse{res.RoomIDs}, JSON: getJoinedRoomsResponse{res.RoomIDs},