Check for empty names

This commit is contained in:
fullwall 2012-12-18 19:27:00 +08:00
parent 1dd695a14f
commit 12c70a0609

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");