diff --git a/gclc/src/main/java/net/bigeon/gclc/command/CommandParameters.java b/gclc/src/main/java/net/bigeon/gclc/command/CommandParameters.java index 3a83d4f..c768837 100644 --- a/gclc/src/main/java/net/bigeon/gclc/command/CommandParameters.java +++ b/gclc/src/main/java/net/bigeon/gclc/command/CommandParameters.java @@ -207,7 +207,11 @@ public final class CommandParameters { * @param string the key * @param value the value */ public void set(final String string, final String value) { - stringArguments.computeIfPresent(string, - (final String k, final String v) -> value); + // DO NOT USE computeIfPresent. This is a HashMap, not a ConcurrentHashMap and + // keys can be associated to null, but computeIfPresent will consider them as + // absent! + if (stringArguments.containsKey(string)) { + stringArguments.put(string, value); + } } }