From daee17c1b74a76a2b07a2208d879c6735fdb9d30 Mon Sep 17 00:00:00 2001 From: David Pilar Date: Sun, 15 Feb 2026 22:58:10 +0100 Subject: [PATCH] Fix possible NPE in InteractiveShellRunner Signed-off-by: David Pilar --- .../springframework/shell/core/InteractiveShellRunner.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/spring-shell-core/src/main/java/org/springframework/shell/core/InteractiveShellRunner.java b/spring-shell-core/src/main/java/org/springframework/shell/core/InteractiveShellRunner.java index 62350d068..dda809439 100644 --- a/spring-shell-core/src/main/java/org/springframework/shell/core/InteractiveShellRunner.java +++ b/spring-shell-core/src/main/java/org/springframework/shell/core/InteractiveShellRunner.java @@ -74,13 +74,14 @@ public void run(String[] args) throws Exception { String input; try { input = this.inputProvider.readInput(); - if (input.isEmpty()) { // ignore empty lines - continue; - } if (input == null || input.equalsIgnoreCase("quit") || input.equalsIgnoreCase("exit")) { print("Exiting the shell"); break; } + if (input.isEmpty()) { + // ignore empty lines + continue; + } } catch (Exception e) { if (this.debugMode) {