Commit dc4d0c37 by 张乐 Committed by GitHub

Merge pull request #453 from nobodyiam/fix-null

fix npe
parents cf6700e9 8d8e88c9
...@@ -122,7 +122,7 @@ public class ReleaseHistoryController { ...@@ -122,7 +122,7 @@ public class ReleaseHistoryController {
releaseHistories.add(releaseHistory); releaseHistories.add(releaseHistory);
//rollback //rollback
if (release.isAbandoned()) { if (release.isAbandoned() && previousRelease != null) {
releaseHistory.setDataChangeLastModifiedTime(release.getDataChangeCreatedTime()); releaseHistory.setDataChangeLastModifiedTime(release.getDataChangeCreatedTime());
ReleaseHistory rollBackReleaseHistory = assembleReleaseHistory(previousRelease, ReleaseHistory rollBackReleaseHistory = assembleReleaseHistory(previousRelease,
ReleaseOperation.ROLLBACK, release.getId()); ReleaseOperation.ROLLBACK, release.getId());
......
...@@ -220,11 +220,12 @@ public class ReleaseService { ...@@ -220,11 +220,12 @@ public class ReleaseService {
Map<String, String> parentConfigurations = parentLatestRelease != null ? Map<String, String> parentConfigurations = parentLatestRelease != null ?
gson.fromJson(parentLatestRelease.getConfigurations(), gson.fromJson(parentLatestRelease.getConfigurations(),
configurationTypeReference) : new HashMap<>(); configurationTypeReference) : new HashMap<>();
long baseReleaseId = parentLatestRelease == null ? 0 : parentLatestRelease.getId();
Map<String, String> childNamespaceToPublishConfigs = mergeConfiguration(parentConfigurations, childNamespaceItems); Map<String, String> childNamespaceToPublishConfigs = mergeConfiguration(parentConfigurations, childNamespaceItems);
Release release = Release release =
branchRelease(parentNamespace, childNamespace, releaseName, releaseComment, branchRelease(parentNamespace, childNamespace, releaseName, releaseComment,
childNamespaceToPublishConfigs, parentLatestRelease.getId(), operator, childNamespaceToPublishConfigs, baseReleaseId, operator,
ReleaseOperation.GRAY_RELEASE); ReleaseOperation.GRAY_RELEASE);
return release; return release;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment