Skip to content

Commit 703d7d3

Browse files
committed
Prevent EmptyStackException in case no stack of prompts is empty
1 parent fc4aabd commit 703d7d3

File tree

1 file changed

+3
-1
lines changed
  • spring-boot-cli/src/main/java/org/springframework/boot/cli/command/shell

1 file changed

+3
-1
lines changed

spring-boot-cli/src/main/java/org/springframework/boot/cli/command/shell/ShellPrompts.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,9 @@ public void pushPrompt(String prompt) {
4343
* @see #pushPrompt(String)
4444
*/
4545
public void popPrompt() {
46-
this.prompts.pop();
46+
if (!this.prompts.isEmpty()) {
47+
this.prompts.pop();
48+
}
4749
}
4850

4951
/**

0 commit comments

Comments
 (0)