Skip to content

Commit 35f06ee

Browse files
committed
check for NPE for getIsAutoDeploying
Signed-off-by: Xun Zhang <xunzh@amazon.com>
1 parent 13ff74e commit 35f06ee

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

plugin/src/main/java/org/opensearch/ml/model/MLModelCacheHelper.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
import java.util.concurrent.ConcurrentHashMap;
1818
import java.util.stream.Collectors;
1919

20+
import org.apache.commons.lang3.BooleanUtils;
2021
import org.opensearch.cluster.service.ClusterService;
2122
import org.opensearch.common.settings.Settings;
2223
import org.opensearch.common.util.TokenBucket;
@@ -299,7 +300,7 @@ public synchronized void setIsAutoDeploying(String modelId, Boolean isModelAutoD
299300
*/
300301
public boolean isAutoDeploying(String modelId) {
301302
MLModelCache modelCache = modelCaches.get(modelId);
302-
return modelCache != null && modelCache.getIsAutoDeploying() == true;
303+
return modelCache != null && modelCache.getIsAutoDeploying() != null && BooleanUtils.isTrue(modelCache.getIsAutoDeploying());
303304
}
304305

305306
/**

0 commit comments

Comments
 (0)