mirror of
https://github.com/matrix-org/dendrite.git
synced 2026-01-01 03:03:10 -06:00
More useful return error rather than a panic
This commit is contained in:
parent
3d757f9f6a
commit
2bb79640f7
|
|
@ -41,10 +41,10 @@ func (r *Admin) PerformAdminEvacuateRoom(
|
|||
}
|
||||
return
|
||||
}
|
||||
if roomInfo.IsStub {
|
||||
if roomInfo == nil || roomInfo.IsStub {
|
||||
res.Error = &api.PerformError{
|
||||
Code: api.PerformErrorBadRequest,
|
||||
Msg: "room is stub",
|
||||
Code: api.PerformErrorNoRoom,
|
||||
Msg: fmt.Sprintf("Room %s not found", req.RoomID),
|
||||
}
|
||||
return
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue