mirror of
https://github.com/moparisthebest/Yaaic
synced 2025-02-16 23:10:11 -05:00
Fix NullPointerException when using upercase characters in command names
This commit is contained in:
parent
d2a638d527
commit
635b90b5da
@ -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) {
|
||||||
|
Loading…
Reference in New Issue
Block a user