mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-06 22:43:10 -06:00
stop using maybe
This commit is contained in:
parent
8f2153d3e6
commit
93543abe4b
|
|
@ -181,25 +181,23 @@ func SetLocalAlias(
|
|||
return *resErr
|
||||
}
|
||||
|
||||
maybeRoomID, err := spec.NewRoomID(r.RoomID)
|
||||
roomID, err := spec.NewRoomID(r.RoomID)
|
||||
if err != nil {
|
||||
return util.JSONResponse{
|
||||
Code: http.StatusBadRequest,
|
||||
JSON: spec.InvalidParam("invalid room ID"),
|
||||
}
|
||||
}
|
||||
roomID := *maybeRoomID // should be safe due to error check
|
||||
|
||||
maybeUserID, err := spec.NewUserID(device.UserID, true)
|
||||
userID, err := spec.NewUserID(device.UserID, true)
|
||||
if err != nil {
|
||||
return util.JSONResponse{
|
||||
Code: http.StatusInternalServerError,
|
||||
JSON: spec.Unknown("internal server error"),
|
||||
}
|
||||
}
|
||||
userID := *maybeUserID
|
||||
|
||||
senderID, err := rsAPI.QuerySenderIDForUser(req.Context(), roomID, userID)
|
||||
senderID, err := rsAPI.QuerySenderIDForUser(req.Context(), *roomID, *userID)
|
||||
if err != nil {
|
||||
util.GetLogger(req.Context()).WithError(err).Error("QuerySenderIDForUser failed")
|
||||
return util.JSONResponse{
|
||||
|
|
|
|||
Loading…
Reference in a new issue