findNoteOrCreate: Create new note with empty string instead of null

Backport of #345 to 1.x

Signed-off-by: Sandro Jäckel <sandro.jaeckel@gmail.com>
This commit is contained in:
Sandro 2020-04-28 00:52:00 +02:00 committed by Sandro Jäckel
parent 68174c0c6f
commit 4c0094a1f8
No known key found for this signature in database
GPG key ID: 3AF5A43A3EECC2E5

View file

@ -19,7 +19,7 @@ exports.findNote = function (req, res, callback, include) {
include: include || null
}).then(function (note) {
if (!note) {
return exports.newNote(req, res, null)
return exports.newNote(req, res, '')
}
if (!exports.checkViewPermission(req, note)) {
return errors.errorForbidden(res)