Fixed an index out of range error in ChatColor.getLastColors

This commit is contained in:
Nathan Adams
2012-03-22 23:09:10 +00:00
parent c11ba8c19d
commit b255f32bef

View File

@@ -222,7 +222,7 @@ public enum ChatColor {
int length = input.length();
while ((lastIndex = input.indexOf(COLOR_CHAR, lastIndex + 1)) != -1) {
if (lastIndex != length) {
if (lastIndex < length - 1) {
char c = input.charAt(lastIndex + 1);
ChatColor col = getByChar(c);