summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorChristoph (Sheogorath) Kern2018-01-18 11:22:18 +0100
committerGitHub2018-01-18 11:22:18 +0100
commit86fbdeea7d2790c0f7b099a7015cdfe22e8667c9 (patch)
tree52c7cec0965f90cb66dbc9e3e3c98776ca45befc /lib
parent8375544dea37f385b9851a8cbd1b264911755ae0 (diff)
parent8bf8a1aef1a54c0551353da8b73f4d72288ba030 (diff)
Merge pull request #681 from SISheogorath/fix/420
Ignore empty values for revision.
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)