Skip to content

Commit 86fbdee

Browse files
authored
Merge pull request #681 from SISheogorath/fix/420
Ignore empty values for revision.
2 parents 8375544 + 8bf8a1a commit 86fbdee

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)