Trim spaces.

This commit is contained in:
filoghost 2014-11-04 14:51:29 +01:00
parent a6b55cebe3
commit 9f875555ea

View File

@ -85,11 +85,11 @@ public class CommandSerializer {
for (Entry<Pattern, Class<? extends IconCommand>> entry : commandTypesMap.entrySet()) {
Matcher matcher = entry.getKey().matcher(input);
if (matcher.find()) {
// Remove the command prefix.
String cleanedCommand = matcher.replaceFirst("");
// Remove the command prefix and trim the spaces.
String cleanCommand = matcher.replaceFirst("").trim();
try {
return entry.getValue().getDeclaredConstructor(String.class).newInstance(cleanedCommand);
return entry.getValue().getDeclaredConstructor(String.class).newInstance(cleanCommand);
} catch (Exception e) {
// Checked at startup.
}