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

View file

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