From 569c34bca0604c659fd07935709ebaeca0200205 Mon Sep 17 00:00:00 2001 From: cyberpwn Date: Tue, 31 Aug 2021 10:17:25 -0400 Subject: [PATCH] Fix expiring commands --- .../decree/virtual/VirtualDecreeCommand.java | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/volmit/iris/util/decree/virtual/VirtualDecreeCommand.java b/src/main/java/com/volmit/iris/util/decree/virtual/VirtualDecreeCommand.java index b15bd9718..668231064 100644 --- a/src/main/java/com/volmit/iris/util/decree/virtual/VirtualDecreeCommand.java +++ b/src/main/java/com/volmit/iris/util/decree/virtual/VirtualDecreeCommand.java @@ -288,7 +288,7 @@ public class VirtualDecreeCommand { if(i == null) { - Iris.warn("Param " + ix + " is null? (" + in.toString(",") + ")"); + continue; } if (i.contains("=")) { @@ -336,6 +336,12 @@ public class VirtualDecreeCommand { KList validOptions = param.getHandler().getPossibilities(value); Iris.debug("Found multiple results for " + key + "=" + value + " in " + getPath() + " using the handler " + param.getHandler().getClass().getSimpleName() + " with potential matches [" + validOptions.toString(",") + "]. Asking client to define one"); String update = pickValidOption(sender, validOptions, param.getHandler(), param.getName(), param.getType().getSimpleName()); + + if(update == null) + { + return null; + } + Iris.debug("Client chose " + update + " for " + key + "=" + value + " (old) in " + getPath()); nowhich.add(ix); in.set(ix--, update); @@ -353,6 +359,12 @@ public class VirtualDecreeCommand { } catch (DecreeWhichException e) { KList validOptions = par.getHandler().getPossibilities(i); String update = pickValidOption(sender, validOptions, par.getHandler(), par.getName(), par.getType().getSimpleName()); + + if(update == null) + { + return null; + } + Iris.debug("Client chose " + update + " for " + par.getName() + "=" + i + " (old) in " + getPath()); nowhich.add(ix); in.set(ix--, update); @@ -439,6 +451,12 @@ public class VirtualDecreeCommand { } catch (DecreeWhichException e) { KList validOptions = i.getHandler().getPossibilities(i.getParam().defaultValue()); String update = pickValidOption(sender, validOptions, i.getHandler(), i.getName(), i.getType().getSimpleName()); + + if(update == null) + { + return false; + } + Iris.debug("Client chose " + update + " for " + i.getName() + "=" + i + " (old) in " + getPath()); value = update; }