Skip to content

Commit f1ab1c9

Browse files
author
王灏
committed
[IMP] 修复NPE
1 parent 8b63044 commit f1ab1c9

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/main/java/io/choerodon/devops/app/service/impl/DevopsDeployAppCenterServiceImpl.java

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -289,10 +289,14 @@ public AppCenterEnvDetailVO envAppDetail(Long projectId, Long appCenterId) {
289289

290290
// 设置deployment的状态、appConfig、containerConfig
291291
DevopsDeploymentDTO devopsDeploymentDTO = devopsDeploymentService.selectByPrimaryKey(centerEnvDTO.getObjectId());
292-
detailVO.setObjectStatus(devopsDeploymentDTO.getStatus());
293-
detailVO.setAppConfig(JsonHelper.unmarshalByJackson(devopsDeploymentDTO.getAppConfig(), DevopsDeployGroupAppConfigVO.class));
294-
detailVO.setContainerConfig(JsonHelper.unmarshalByJackson(devopsDeploymentDTO.getContainerConfig(), new TypeReference<List<DevopsDeployGroupContainerConfigVO>>() {
295-
}));
292+
if (devopsDeploymentDTO != null) {
293+
detailVO.setObjectStatus(devopsDeploymentDTO.getStatus());
294+
detailVO.setAppConfig(JsonHelper.unmarshalByJackson(devopsDeploymentDTO.getAppConfig(), DevopsDeployGroupAppConfigVO.class));
295+
detailVO.setContainerConfig(JsonHelper.unmarshalByJackson(devopsDeploymentDTO.getContainerConfig(), new TypeReference<List<DevopsDeployGroupContainerConfigVO>>() {
296+
}));
297+
detailVO.setLastUpdateDate(devopsDeploymentDTO.getLastUpdateDate());
298+
detailVO.setUpdater(baseServiceClientOperator.queryUserByUserId(devopsDeploymentDTO.getLastUpdatedBy() == 0L ? centerEnvDTO.getLastUpdatedBy() : devopsDeploymentDTO.getLastUpdatedBy()));
299+
}
296300
}
297301
// 环境信息查询
298302
DevopsEnvironmentDTO environmentDTO = environmentService.baseQueryById(centerEnvDTO.getEnvId());

0 commit comments

Comments
 (0)