[BLUEJ-984] Pressing enter at end of file causes exception
There is a bug in the newline action which throws an exception if the caret is at the end of the file (end of last line) when you press enter:
Exception in thread "JavaFX Application Thread" java.lang.StringIndexOutOfBoundsException: String index out of range: 0 at java.lang.String.charAt(String.java:658) at bluej.editor.moe.MoeActions.doIndent(MoeActions.java:812) at bluej.editor.moe.MoeActions.lambda$newLineAction$30(MoeActions.java:1473) at bluej.editor.moe.MoeActions$1.actionPerformed(MoeActions.java:1148) at bluej.editor.moe.MoeActions.lambda$null$1(MoeActions.java:154) at org.fxmisc.wellbehaved.event.InputMap.lambda$consume$7(InputMap.java:93)
Issue metadata
- Issue type: Bug
- Priority: Medium
- Fix versions: 4.1.0