fix: Update setStringValue method to handle null values by removing the key from context

This commit is contained in:
extio-de
2025-10-13 21:20:18 +02:00
parent b31ddda715
commit 1ba9227311

View File

@@ -89,8 +89,12 @@ public final class AgentContext {
} }
public void setStringValue(final String key, final String value) { public void setStringValue(final String key, final String value) {
if (value == null) {
this.context.remove(key);
} else {
this.context.put(key, List.of(value)); this.context.put(key, List.of(value));
} }
}
public List<String> getStringValues(final String key) { public List<String> getStringValues(final String key) {
final var values = this.context.get(key); final var values = this.context.get(key);