Skip to content

Commit c2266a8

Browse files
authored
Fix tenant id null casue NPE (#4463)
* fix NPE Signed-off-by: Hailong Cui <[email protected]> * fix version conflicts Signed-off-by: Hailong Cui <[email protected]> * Revert "fix version conflicts" This reverts commit 8b0194c. Signed-off-by: Hailong Cui <[email protected]> --------- Signed-off-by: Hailong Cui <[email protected]>
1 parent fa3ed30 commit c2266a8

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -502,7 +502,12 @@ private void runReAct(
502502
);
503503
toolParams.put(TENANT_ID_FIELD, tenantId);
504504
lastToolParams.clear();
505-
lastToolParams.putAll(toolParams);
505+
toolParams.forEach((key, value) -> {
506+
// For the case like tenant id is null
507+
if (key != null && value != null) {
508+
lastToolParams.put(key, value);
509+
}
510+
});
506511
runTool(
507512
tools,
508513
toolSpecMap,

0 commit comments

Comments
 (0)