summary refs log tree commit diff stats
path: root/src/main/java/ganarchy/friendcode/sam/I2PSamCommand.java
diff options
context:
space:
mode:
authorSoniEx2 <endermoneymod@gmail.com>2022-07-14 00:30:46 -0300
committerSoniEx2 <endermoneymod@gmail.com>2022-07-14 00:30:46 -0300
commit5200e97d90e2adbeebdf06bd756f66df4e8f1b01 (patch)
treef107d2e773f331e63c2e6b90eb8f9f0fc019ea56 /src/main/java/ganarchy/friendcode/sam/I2PSamCommand.java
parent75a06bc421522ca131ee1751f84fcf6970cebc98 (diff)
Add check for empty key
Diffstat (limited to 'src/main/java/ganarchy/friendcode/sam/I2PSamCommand.java')
-rw-r--r--src/main/java/ganarchy/friendcode/sam/I2PSamCommand.java4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/main/java/ganarchy/friendcode/sam/I2PSamCommand.java b/src/main/java/ganarchy/friendcode/sam/I2PSamCommand.java
index bed5bb8..b1cece8 100644
--- a/src/main/java/ganarchy/friendcode/sam/I2PSamCommand.java
+++ b/src/main/java/ganarchy/friendcode/sam/I2PSamCommand.java
@@ -45,6 +45,10 @@ record I2PSamCommand(String name, String opcode, Map<String, String> parameters)
             throw new IllegalArgumentException("name must not be empty");
         }
 
+        if (this.parameters.containsKey("")) {
+            throw new IllegalArgumentException("parameter key must not be empty");
+        }
+
         // check for PING/PONG
         if (this.name.equals("PING") || this.name.equals("PONG")) {
             // reject parameters