提交 dc4d0c37 编写于 作者: 张乐 提交者: GitHub

Merge pull request #453 from nobodyiam/fix-null

fix npe
......@@ -122,7 +122,7 @@ public class ReleaseHistoryController {
releaseHistories.add(releaseHistory);
//rollback
if (release.isAbandoned()) {
if (release.isAbandoned() && previousRelease != null) {
releaseHistory.setDataChangeLastModifiedTime(release.getDataChangeCreatedTime());
ReleaseHistory rollBackReleaseHistory = assembleReleaseHistory(previousRelease,
ReleaseOperation.ROLLBACK, release.getId());
......
......@@ -220,11 +220,12 @@ public class ReleaseService {
Map<String, String> parentConfigurations = parentLatestRelease != null ?
gson.fromJson(parentLatestRelease.getConfigurations(),
configurationTypeReference) : new HashMap<>();
long baseReleaseId = parentLatestRelease == null ? 0 : parentLatestRelease.getId();
Map<String, String> childNamespaceToPublishConfigs = mergeConfiguration(parentConfigurations, childNamespaceItems);
Release release =
branchRelease(parentNamespace, childNamespace, releaseName, releaseComment,
childNamespaceToPublishConfigs, parentLatestRelease.getId(), operator,
childNamespaceToPublishConfigs, baseReleaseId, operator,
ReleaseOperation.GRAY_RELEASE);
return release;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册