Fix ArrayIndexOutOfBoundsException when an empty command is typed
This commit is contained in:
@@ -67,6 +67,12 @@ public class CommandManager
|
|||||||
|
|
||||||
String[] split = typedText.split(" ");
|
String[] split = typedText.split(" ");
|
||||||
|
|
||||||
|
// Fixes ArrayIndexOutOfBounds when typing ":: "
|
||||||
|
if (split.length == 0)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
String command = split[0];
|
String command = split[0];
|
||||||
String[] args = Arrays.copyOfRange(split, 1, split.length);
|
String[] args = Arrays.copyOfRange(split, 1, split.length);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user