mirror of
https://github.com/zadam/trilium.git
synced 2025-02-23 22:44:44 +08:00
don't save zero byte buffers as note revisions
This commit is contained in:
parent
8855f29a49
commit
8a435a2149
1 changed files with 4 additions and 4 deletions
|
@ -23,17 +23,17 @@ function protectNoteRevisions(note) {
|
|||
|
||||
/**
|
||||
* @param {Note} note
|
||||
* @return {NoteRevision}
|
||||
* @return {NoteRevision|null}
|
||||
*/
|
||||
function createNoteRevision(note) {
|
||||
if (note.hasLabel("disableVersioning")) {
|
||||
return;
|
||||
return null;
|
||||
}
|
||||
|
||||
const content = note.getContent();
|
||||
|
||||
if (!content) {
|
||||
return;
|
||||
if (!content || (Buffer.isBuffer(content) && content.byteLength === 0)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const contentMetadata = note.getContentMetadata();
|
||||
|
|
Loading…
Reference in a new issue