/v2/players/kick no longer 500s if a player name isn't specified.

Fixes #361
This commit is contained in:
Lucas Nicodemus 2012-02-09 21:48:37 -07:00
parent ee20946cdd
commit 5cdd537ebd

View file

@ -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)