     doc = Meteor.wrapAsync(ShareJS.model.getSnapshot) id
     #console.log id, 'changed to', doc.snapshot
     msg = findMessage id
+    return unless msg?
     unless msg.body == doc.snapshot
       _messageUpdate id,
         body: doc.snapshot

  return unless Meteor.isServer
  Messages.update id,
    $pull: editing: username
  unless Messages.findOne(id).editing?.length  ## removed last editor
    Meteor.clearTimeout stopTimers[id]
    editor2messageUpdate id, [username]
    ShareJS.model.delete id

    Meteor.clearTimeout stopTimers[id]
    stopTimers[id] = Meteor.setTimeout ->
      ## This code is like an extreme form of `messageEditStop` below:
      msg = findMessage id
      return unless msg?  # maybe superdeleted
      editing = msg.editing ? []
      editor2messageUpdate id, editing
      Messages.update id,
        $unset: editing: ''
