Skip to content

Commit 2c63e8d

Browse files
authored
check if model id is null when undeploy (opensearch-project#2006)
Signed-off-by: Yaliang Wu <ylwu@amazon.com>
1 parent 21902aa commit 2c63e8d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

plugin/src/main/java/org/opensearch/ml/action/undeploy/TransportUndeployModelsAction.java

+4
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,10 @@ protected void doExecute(Task task, ActionRequest request, ActionListener<MLUnde
107107
String[] modelIds = undeployModelsRequest.getModelIds();
108108
String[] targetNodeIds = undeployModelsRequest.getNodeIds();
109109

110+
if (modelIds == null) {
111+
listener.onFailure(new IllegalArgumentException("Must set specific model ids to undeploy"));
112+
return;
113+
}
110114
if (modelIds.length == 1) {
111115
String modelId = modelIds[0];
112116
validateAccess(modelId, ActionListener.wrap(hasPermissionToUndeploy -> {

0 commit comments

Comments
 (0)