Commits

Sebastian Bub committed eb7fbc3

graceful ignore empty parameters, e.g. a=1&&b=1 <- double & signs

  • Participants
  • Parent commits 2bd3052

Comments (0)

Files changed (1)

File src/main/java/de/derbub/rpigpio/SimpleCommand.java

             log.debug("read in " + param);
             Matcher m = CONDITION_OR_ASSIGN_PATTERN.matcher(param);
             m.matches();
-            if (m.groupCount() != 3) {
-                log.warn("ignoring command _" + param + "_ Regexp does not match.");
-                continue;
-            }
             String key, value, condition;
             try {
                 key = URLDecoder.decode(m.group(1), "UTF-8");
                 key = m.group(1);
                 condition = m.group(2);
                 value = m.group(3);
+            } catch (IllegalStateException ise) {
+                log.warn("ignoring command _" + param + "_ Regexp does not match.");
+                continue;
             }
             SimpleCommand tmpCmd = new SimpleCommand(key, value, condition);
             tmpList.add(tmpCmd);