From 635b90b5da1ce23d1c1cc40cc775238459da2702 Mon Sep 17 00:00:00 2001 From: Sebastian Kaspari Date: Sun, 6 Mar 2011 14:03:34 +0100 Subject: [PATCH] Fix NullPointerException when using upercase characters in command names --- application/src/org/yaaic/command/CommandParser.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/application/src/org/yaaic/command/CommandParser.java b/application/src/org/yaaic/command/CommandParser.java index f2aae27..02014b4 100644 --- a/application/src/org/yaaic/command/CommandParser.java +++ b/application/src/org/yaaic/command/CommandParser.java @@ -166,12 +166,14 @@ public class CommandParser public void handleClientCommand(String type, String[] params, Server server, Conversation conversation, IRCService service) { BaseHandler command = null; + if (commands.containsKey(type.toLowerCase())) { - command = commands.get(type); + command = commands.get(type.toLowerCase()); } else if (aliases.containsKey(type.toLowerCase())) { String commandInCommands = aliases.get(type.toLowerCase()); command = commands.get(commandInCommands); } + try { command.execute(params, server, conversation, service); } catch(CommandException e) {