diff options
Diffstat (limited to 'lib/realtime.js')
-rw-r--r-- | lib/realtime.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/realtime.js b/lib/realtime.js index 0edf647c..b7a17d34 100644 --- a/lib/realtime.js +++ b/lib/realtime.js @@ -540,7 +540,7 @@ function ifMayEdit(socket, callback) { break; case "locked": case "private": //only owner can change - if (note.owner != socket.request.user.id) + if (!note.owner || note.owner != socket.request.user.id) mayEdit = false; break; } @@ -641,7 +641,7 @@ function connection(socket) { if (!noteId || !notes[noteId]) return; var note = notes[noteId]; //Only owner can change permission - if (note.owner == socket.request.user.id) { + if (note.owner && note.owner == socket.request.user.id) { note.permission = permission; models.Note.update({ permission: permission |