Skip to content

Commit

Permalink
check for NPE for getIsAutoDeploying
Browse files Browse the repository at this point in the history
Signed-off-by: Xun Zhang <[email protected]>
  • Loading branch information
Zhangxunmt committed May 6, 2024
1 parent 13ff74e commit 35f06ee
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import java.util.concurrent.ConcurrentHashMap;
import java.util.stream.Collectors;

import org.apache.commons.lang3.BooleanUtils;
import org.opensearch.cluster.service.ClusterService;
import org.opensearch.common.settings.Settings;
import org.opensearch.common.util.TokenBucket;
Expand Down Expand Up @@ -299,7 +300,7 @@ public synchronized void setIsAutoDeploying(String modelId, Boolean isModelAutoD
*/
public boolean isAutoDeploying(String modelId) {
MLModelCache modelCache = modelCaches.get(modelId);
return modelCache != null && modelCache.getIsAutoDeploying() == true;
return modelCache != null && modelCache.getIsAutoDeploying() != null && BooleanUtils.isTrue(modelCache.getIsAutoDeploying());
}

/**
Expand Down

0 comments on commit 35f06ee

Please sign in to comment.