summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
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)