Fix NullPointerException when using upercase characters in command names

This commit is contained in:
Sebastian Kaspari 2011-03-06 14:03:34 +01:00
parent d2a638d527
commit 635b90b5da
1 changed files with 3 additions and 1 deletions

View File

@ -166,12 +166,14 @@ public class CommandParser
public void handleClientCommand(String type, String[] params, Server server, Conversation conversation, IRCService service) public void handleClientCommand(String type, String[] params, Server server, Conversation conversation, IRCService service)
{ {
BaseHandler command = null; BaseHandler command = null;
if (commands.containsKey(type.toLowerCase())) { if (commands.containsKey(type.toLowerCase())) {
command = commands.get(type); command = commands.get(type.toLowerCase());
} else if (aliases.containsKey(type.toLowerCase())) { } else if (aliases.containsKey(type.toLowerCase())) {
String commandInCommands = aliases.get(type.toLowerCase()); String commandInCommands = aliases.get(type.toLowerCase());
command = commands.get(commandInCommands); command = commands.get(commandInCommands);
} }
try { try {
command.execute(params, server, conversation, service); command.execute(params, server, conversation, service);
} catch(CommandException e) { } catch(CommandException e) {