diff options
author | SoniEx2 <endermoneymod@gmail.com> | 2022-07-14 00:30:46 -0300 |
---|---|---|
committer | SoniEx2 <endermoneymod@gmail.com> | 2022-07-14 00:30:46 -0300 |
commit | 5200e97d90e2adbeebdf06bd756f66df4e8f1b01 (patch) | |
tree | f107d2e773f331e63c2e6b90eb8f9f0fc019ea56 /src/main/java/ganarchy/friendcode/sam/I2PSamCommand.java | |
parent | 75a06bc421522ca131ee1751f84fcf6970cebc98 (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.java | 4 |
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 |