From 279c96bb2bc19074700d5769930c0c41af8d73f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Borowiecki?= Date: Sun, 8 Jan 2023 15:39:59 +0000 Subject: [PATCH] parse txnstate value as string even if it looks like a valid JSON array --- src/org/minima/system/commands/Command.java | 22 ++++++++++----------- 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/src/org/minima/system/commands/Command.java b/src/org/minima/system/commands/Command.java index aae4534fe..d5f7ce492 100644 --- a/src/org/minima/system/commands/Command.java +++ b/src/org/minima/system/commands/Command.java @@ -507,23 +507,21 @@ public static Command getCommand(String zCommand) { comms.getParams().put(name, json); }else if(value.startsWith("[") && value.endsWith("]")) { - + + //Is this a state variable + if(command.equals("txnstate")) { + + //Could be a String variable.. add normal String parameter to.. + comms.getParams().put(name, value); + + continue; + } //It's a JSONArray..! JSONArray json = null; try { json = (JSONArray) new JSONParser().parse(value); } catch (ParseException e) { - - //Is this a state variable - if(command.equals("txnstate")) { - - //Could be a String variable.. add normal String parameter to.. - comms.getParams().put(name, value); - - continue; - } - - //Otherwise is just a broken JSONArray + return new missingcmd(command,"Invalid JSON parameter for "+command+" @ "+token+" "+e.toString()); }