Skip to content

Commit c2e6b53

Browse files
committed
fix NPE
Signed-off-by: Hailong Cui <[email protected]>
1 parent b1f7291 commit c2e6b53

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

ml-algorithms/src/main/java/org/opensearch/ml/engine/algorithms/agent/MLChatAgentRunner.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -502,7 +502,11 @@ private void runReAct(
502502
);
503503
toolParams.put(TENANT_ID_FIELD, tenantId);
504504
lastToolParams.clear();
505-
lastToolParams.putAll(toolParams);
505+
toolParams.forEach((key, value) -> {
506+
if (key != null && value != null) {
507+
lastToolParams.put(key, value);
508+
}
509+
});
506510
runTool(
507511
tools,
508512
toolSpecMap,

0 commit comments

Comments
 (0)