Skip to content

Commit 77e49d4

Browse files
committed
fix: guard against empty runId and graphKey
1 parent 4d6565c commit 77e49d4

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -146,10 +146,10 @@ private static Decoded parseJson(String json) {
146146
}
147147
}
148148

149-
if (runId == null || runId.isEmpty()) {
149+
if (runId == null || runId.trim().isEmpty()) {
150150
throw new IllegalArgumentException("Resumption token missing required field 'runId'");
151151
}
152-
if (configKey == null || configKey.isEmpty()) {
152+
if (configKey == null || configKey.trim().isEmpty()) {
153153
throw new IllegalArgumentException("Resumption token missing required field 'configKey'");
154154
}
155155
if (version == null) {
@@ -360,10 +360,10 @@ private static DecodedGraph parseGraphJson(String json) {
360360
}
361361
}
362362

363-
if (runId == null) {
363+
if (runId == null || runId.trim().isEmpty()) {
364364
throw new IllegalArgumentException("Graph resumption token missing required field 'runId'");
365365
}
366-
if (graphKey == null) {
366+
if (graphKey == null || graphKey.trim().isEmpty()) {
367367
throw new IllegalArgumentException("Graph resumption token missing required field 'graphKey'");
368368
}
369369
if (version == null) {

0 commit comments

Comments
 (0)