Fix NPE when inserting new line anywhere but at the end

This commit is contained in:
johni0702
2015-08-16 11:33:52 +02:00
parent 7808f37c5e
commit 8d7bc1b8d6
2 changed files with 113 additions and 104 deletions

View File

@@ -252,7 +252,7 @@ public abstract class AbstractGuiTextArea<T extends AbstractGuiTextArea<T>>
newText[cursorY + 1] = text[cursorY].substring(cursorX);
if (cursorY + 1 < text.length) {
System.arraycopy(text, cursorY + 1, newText, cursorY + 1, text.length - cursorY - 1);
System.arraycopy(text, cursorY + 1, newText, cursorY + 2, text.length - cursorY - 1);
}
text = newText;
selectionX = cursorX = 0;