Skip to content

Commit

Permalink
Merge pull request #572 from liimaorg/exruntime_nullpointer
Browse files Browse the repository at this point in the history
add missing deployment exRuntime code
  • Loading branch information
yvespp authored Sep 3, 2020
2 parents a178164 + 4dfd24b commit 5dcc397
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,14 @@ public String getDeletedReleaseName(DeploymentEntity deployment) {
return deployment.getRelease().getName();
}

public String getDeletedRuntimeName(DeploymentEntity deployment) {
if (deployment.getRuntime() == null) {
ResourceEntity res = (ResourceEntity) auditService.getDeletedEntity(new ResourceEntity(), deployment.getExRuntimeResourceId());
return res.getName();
}
return deployment.getRuntime().getName();
}

private void populateDeletedContextMap() {
deletedContextNameIdMap = new HashMap<>();
List<ContextEntity> allDeletedEnvironments = contextLocator.getAllDeletedEnvironments();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,9 @@ private DeploymentDTO createPreservedDeploymentDTO(DeploymentEntity deployment)
if (deployment.getExReleaseId() != null) {
properties.setReleaseName(deploymentBoundary.getDeletedReleaseName(deployment));
}
if (deployment.getExRuntimeResourceId() != null) {
properties.setRuntimeName(deploymentBoundary.getDeletedRuntimeName(deployment));
}
deploymentDTO.setPreservedValues(deployment, properties);
deploymentDTO.setActions(new DeploymentActionsDTO());
return deploymentDTO;
Expand Down

0 comments on commit 5dcc397

Please sign in to comment.