Ignore empty values for revision.

Fixes #420
This commit is contained in:
Sheogorath 2018-01-18 11:19:47 +01:00
parent 8375544dea
commit 8bf8a1aef1
No known key found for this signature in database
GPG Key ID: 1F05CC3635CDDFFD
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)