Skip to content

Commit d0ae81b

Browse files
committed
fix: make GraphEdge.handoff a defensive unmodifiable copy
1 parent 0bb8379 commit d0ae81b

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

  • lib/sdk/server-ai/src/main/java/com/launchdarkly/sdk/server/ai

lib/sdk/server-ai/src/main/java/com/launchdarkly/sdk/server/ai/GraphEdge.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import com.launchdarkly.sdk.LDValue;
44

55
import java.util.Collections;
6+
import java.util.LinkedHashMap;
67
import java.util.Map;
78

89
/**
@@ -17,7 +18,9 @@ public final class GraphEdge {
1718

1819
public GraphEdge(String key, Map<String, LDValue> handoff) {
1920
this.key = key;
20-
this.handoff = handoff;
21+
this.handoff = handoff != null
22+
? Collections.unmodifiableMap(new LinkedHashMap<>(handoff))
23+
: null;
2124
}
2225

2326
/**

0 commit comments

Comments
 (0)