Skip to content

Commit 2cf0fc0

Browse files
dhrubo-osgithub-actions[bot]
authored andcommitted
code refactor not to occur nullpointer exception (#2816)
Signed-off-by: Dhrubo Saha <[email protected]> (cherry picked from commit a4dff63)
1 parent 04918e5 commit 2cf0fc0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -925,7 +925,7 @@ private void deleteOrUpdateModelGroup(String modelGroupID, Boolean doesVersionCr
925925
// This checks if model group is created when registering the version. If yes,
926926
// model group is deleted since the version registration
927927
// had failed. Else model group latest version is decremented by 1
928-
if (doesVersionCreateModelGroup) {
928+
if (Boolean.TRUE.equals(doesVersionCreateModelGroup)) {
929929
DeleteRequest deleteModelGroupRequest = new DeleteRequest();
930930
deleteModelGroupRequest.index(ML_MODEL_GROUP_INDEX).id(modelGroupID).setRefreshPolicy(WriteRequest.RefreshPolicy.IMMEDIATE);
931931
client.delete(deleteModelGroupRequest);

0 commit comments

Comments
 (0)