From cf9d55747e07c2d6b5ee6ea121fa70c56f1872ff Mon Sep 17 00:00:00 2001 From: Johannes Mockenhaupt Date: Wed, 20 Dec 2017 21:14:35 +0100 Subject: [PATCH] Fix NPE. --- .../src/main/java/de/jotomo/ruffyscripter/RuffyScripter.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ruffyscripter/src/main/java/de/jotomo/ruffyscripter/RuffyScripter.java b/ruffyscripter/src/main/java/de/jotomo/ruffyscripter/RuffyScripter.java index 18604cb7b6..44deb879e8 100644 --- a/ruffyscripter/src/main/java/de/jotomo/ruffyscripter/RuffyScripter.java +++ b/ruffyscripter/src/main/java/de/jotomo/ruffyscripter/RuffyScripter.java @@ -241,7 +241,7 @@ public class RuffyScripter implements RuffyCommands { List violations = cmd.validateArguments(); if (!violations.isEmpty()) { log.error("Command argument violations: " + Joiner.on(", ").join(violations)); - return new CommandResult().success(false).state(readPumpStateInternal()); + return new CommandResult().success(false).state(new PumpState()); } synchronized (RuffyScripter.class) { @@ -423,7 +423,7 @@ public class RuffyScripter implements RuffyCommands { private PumpState recoverFromCommandFailure() { Menu menu = this.currentMenu; if (menu == null) { - return null; + return new PumpState(); } MenuType type = menu.getType(); if (type != MenuType.WARNING_OR_ERROR && type != MenuType.MAIN_MENU) {