Skip to content

Commit 8bf8a1a

Browse files
committed
Ignore empty values for revision.
Fixes #420
1 parent 8375544 commit 8bf8a1a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/models/revision.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,8 +237,8 @@ module.exports = function (sequelize, DataTypes) {
237237
// if no revision available
238238
Revision.create({
239239
noteId: note.id,
240-
lastContent: note.content,
241-
length: note.content.length,
240+
lastContent: note.content ? note.content : '',
241+
length: note.content ? note.content.length : 0,
242242
authorship: note.authorship
243243
}).then(function (revision) {
244244
Revision.finishSaveNoteRevision(note, revision, callback)

0 commit comments

Comments
 (0)