Merge pull request #681 from SISheogorath/fix/420

Ignore empty values for revision.
This commit is contained in:
Christoph (Sheogorath) Kern 2018-01-18 11:22:18 +01:00 committed by GitHub
commit 86fbdeea7d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -237,8 +237,8 @@ module.exports = function (sequelize, DataTypes) {
// if no revision available
Revision.create({
noteId: note.id,
lastContent: note.content,
length: note.content.length,
lastContent: note.content ? note.content : '',
length: note.content ? note.content.length : 0,
authorship: note.authorship
}).then(function (revision) {
Revision.finishSaveNoteRevision(note, revision, callback)