mirror of
https://github.com/matrix-org/dendrite.git
synced 2026-01-03 04:03:09 -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
|
return
|
||||||
}
|
}
|
||||||
if roomInfo.IsStub {
|
if roomInfo == nil || roomInfo.IsStub {
|
||||||
res.Error = &api.PerformError{
|
res.Error = &api.PerformError{
|
||||||
Code: api.PerformErrorBadRequest,
|
Code: api.PerformErrorNoRoom,
|
||||||
Msg: "room is stub",
|
Msg: fmt.Sprintf("Room %s not found", req.RoomID),
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue