From 8bf8a1aef1a54c0551353da8b73f4d72288ba030 Mon Sep 17 00:00:00 2001 From: Sheogorath Date: Thu, 18 Jan 2018 11:19:47 +0100 Subject: [PATCH] Ignore empty values for revision. Fixes #420 --- lib/models/revision.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/models/revision.js b/lib/models/revision.js index 32c57d0..170931b 100644 --- a/lib/models/revision.js +++ b/lib/models/revision.js @@ -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)