Check for empty names

This commit is contained in:
fullwall 2012-12-18 19:27:00 +08:00
parent 8615b515c8
commit 02a346eea4
1 changed files with 3 additions and 0 deletions

View File

@ -269,6 +269,9 @@ public class NPCCommands {
Messaging.sendErrorTr(sender, Messages.NPC_NAME_TOO_LONG);
name = name.substring(0, 15);
}
if (name.length() <= 0)
throw new CommandException();
EntityType type = EntityType.PLAYER;
if (args.hasValueFlag("type")) {
String inputType = args.getFlag("type");