fix: sync project error #83 (#84)

This commit is contained in:
vran
2022-04-12 11:57:18 +08:00
committed by GitHub
parent 0a34e3a98b
commit 70d65aa67a
3 changed files with 15 additions and 9 deletions

View File

@@ -108,7 +108,12 @@ public class DocumentService {
eventPublisher.publish(new DocumentUpdated(diff, version + 1, version, projectId));
} else {
saveNewDocument(current, 1L, projectId);
RootDiff diff = Diffs.diff(null, current);
RootDiff diff = null;
try {
diff = Diffs.diff(null, current);
} catch (Exception e) {
log.error("diff project " + projectId + " error, fallback diff type to NONE", e);
}
eventPublisher.publish(new DocumentUpdated(diff, 1L, null, projectId));
}
}