Fix NPE in ToscaElementLifecycleOperation - handlePreviousVersionRelation 85/126285/3
authorfranciscovila <javier.paradela.vila@est.tech>
Wed, 15 Dec 2021 17:25:23 +0000 (17:25 +0000)
committerVasyl Razinkov <vasyl.razinkov@est.tech>
Fri, 17 Dec 2021 10:38:17 +0000 (10:38 +0000)
Change-Id: I8a0ffe60755788857842f5baa98dd34ccd81f33d
Signed-off-by: franciscovila <javier.paradela.vila@est.tech>
Issue-ID: SDC-2968
fixed review comments

catalog-model/src/main/java/org/openecomp/sdc/be/model/jsonjanusgraph/operations/ToscaElementLifecycleOperation.java

index d46d4a5..cf2db79 100644 (file)
@@ -899,7 +899,7 @@ public class ToscaElementLifecycleOperation extends BaseOperation {
                 if (status != JanusGraphOperationStatus.OK) {
                     CommonUtility.addRecordToLog(log, LogLevelEnum.DEBUG,
                         "Failed to create edge with label {} from vertex {} to tosca element vertex {} on graph. Status is {}. ",
-                        EdgeLabelEnum.VERSION, previousCertifiedToscaElement.property(GraphPropertyEnum.UNIQUE_ID.getProperty()),
+                        EdgeLabelEnum.VERSION, null != previousCertifiedToscaElement ? previousCertifiedToscaElement.property(GraphPropertyEnum.UNIQUE_ID.getProperty()) : null,
                         clonedToscaElement.getUniqueId(), status);
                     result = Either.right(DaoStatusConverter.convertJanusGraphStatusToStorageStatus(status));
                 }