diff --git a/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/shell/ShellPrompts.java b/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/shell/ShellPrompts.java index a792801a7f4..bdc8e296a4d 100644 --- a/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/shell/ShellPrompts.java +++ b/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/shell/ShellPrompts.java @@ -43,7 +43,9 @@ public class ShellPrompts { * @see #pushPrompt(String) */ public void popPrompt() { - this.prompts.pop(); + if (!this.prompts.isEmpty()) { + this.prompts.pop(); + } } /**