Skip to content

Commit 9f35a7d

Browse files
czpilarfmbenhassine
authored andcommitted
Fix possible NPE in InteractiveShellRunner
Signed-off-by: David Pilar <david@czpilar.net>
1 parent 29ddc11 commit 9f35a7d

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

spring-shell-core/src/main/java/org/springframework/shell/core/InteractiveShellRunner.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,13 +74,14 @@ public void run(String[] args) throws Exception {
7474
String input;
7575
try {
7676
input = this.inputProvider.readInput();
77-
if (input.isEmpty()) { // ignore empty lines
78-
continue;
79-
}
8077
if (input == null || input.equalsIgnoreCase("quit") || input.equalsIgnoreCase("exit")) {
8178
print("Exiting the shell");
8279
break;
8380
}
81+
if (input.isEmpty()) {
82+
// ignore empty lines
83+
continue;
84+
}
8485
}
8586
catch (Exception e) {
8687
if (this.debugMode) {

0 commit comments

Comments
 (0)