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
This commit is contained in:
Phillip Webb 2014-01-16 09:19:26 -08:00
parent 796816e8c3
commit 28a92d22dc

View File

@ -175,8 +175,8 @@ public class Shell {
}
private void runInputLoop() throws Exception {
while (true) {
String line = this.consoleReader.readLine(getPrompt());
String line;
while ((line = this.consoleReader.readLine(getPrompt())) != null) {
while (line.endsWith("\\")) {
line = line.substring(0, line.length() - 1);
line += this.consoleReader.readLine("> ");