summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSheogorath2018-01-18 11:19:47 +0100
committerSheogorath2018-01-18 11:19:47 +0100
commit8bf8a1aef1a54c0551353da8b73f4d72288ba030 (patch)
tree52c7cec0965f90cb66dbc9e3e3c98776ca45befc
parent8375544dea37f385b9851a8cbd1b264911755ae0 (diff)
Ignore empty values for revision.
Fixes #420
Diffstat (limited to '')
-rw-r--r--lib/models/revision.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/models/revision.js b/lib/models/revision.js
index 32c57d03..170931b8 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)