fix: leak of version number inference when create or update content patch (#1690)

pull/1697/head
guqing 2022-03-02 13:40:19 +08:00 committed by GitHub
parent 4f1a3c5f0b
commit 4d71185066
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -70,7 +70,8 @@ public class ContentPatchLogServiceImpl implements ContentPatchLogService {
if (latestPatchLog == null) {
// There is no patchLog record
version = 1;
} else if (PostStatus.PUBLISHED.equals(latestPatchLog.getStatus())) {
} else if (PostStatus.PUBLISHED.equals(latestPatchLog.getStatus())
|| PostStatus.INTIMATE.equals(latestPatchLog.getStatus())) {
// There is no draft, a draft record needs to be created
// so the version number needs to be incremented
version = latestPatchLog.getVersion() + 1;