/v2/players/kick no longer 500s if a player name isn't specified.
Fixes #361
This commit is contained in:
parent
ee20946cdd
commit
5cdd537ebd
1 changed files with 6 additions and 0 deletions
|
|
@ -578,6 +578,12 @@ namespace TShockAPI
|
|||
{
|
||||
var returnBlock = new Dictionary<string, object>();
|
||||
var playerParam = parameters["player"];
|
||||
if (playerParam == null)
|
||||
{
|
||||
returnBlock.Add("status", "400");
|
||||
returnBlock.Add("error", "Unspecified name.");
|
||||
return returnBlock;
|
||||
}
|
||||
var found = TShock.Utils.FindPlayer(playerParam);
|
||||
var reason = parameters["reason"];
|
||||
if (found.Count == 0)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue