From 703d7d3fd99810656a5d6afdacb8580ebfc32782 Mon Sep 17 00:00:00 2001 From: Christian Dupuis Date: Sun, 16 Feb 2014 14:05:25 +0100 Subject: [PATCH] Prevent EmptyStackException in case no stack of prompts is empty --- .../springframework/boot/cli/command/shell/ShellPrompts.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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(); + } } /**