Commit 28a92d22 authored by Phillip Webb's avatar Phillip Webb

Prevent CTRL-D from causing NPE in shell

Update the integrated shell to deal with a null line which can be
triggered with CTRL-D.

Fixes gh-229
parent 796816e8
...@@ -175,8 +175,8 @@ public class Shell { ...@@ -175,8 +175,8 @@ public class Shell {
} }
private void runInputLoop() throws Exception { private void runInputLoop() throws Exception {
while (true) { String line;
String line = this.consoleReader.readLine(getPrompt()); while ((line = this.consoleReader.readLine(getPrompt())) != null) {
while (line.endsWith("\\")) { while (line.endsWith("\\")) {
line = line.substring(0, line.length() - 1); line = line.substring(0, line.length() - 1);
line += this.consoleReader.readLine("> "); line += this.consoleReader.readLine("> ");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment