Skip to content

Commit a4dff63

Browse files
authored
code refactor not to occur nullpointer exception (opensearch-project#2816)
Signed-off-by: Dhrubo Saha <[email protected]>
1 parent 684627a commit a4dff63

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
@@ -929,7 +929,7 @@ private void deleteOrUpdateModelGroup(String modelGroupID, Boolean doesVersionCr
929929
// This checks if model group is created when registering the version. If yes,
930930
// model group is deleted since the version registration
931931
// had failed. Else model group latest version is decremented by 1
932-
if (doesVersionCreateModelGroup) {
932+
if (Boolean.TRUE.equals(doesVersionCreateModelGroup)) {
933933
DeleteRequest deleteModelGroupRequest = new DeleteRequest();
934934
deleteModelGroupRequest.index(ML_MODEL_GROUP_INDEX).id(modelGroupID).setRefreshPolicy(WriteRequest.RefreshPolicy.IMMEDIATE);
935935
client.delete(deleteModelGroupRequest);

0 commit comments

Comments
 (0)