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

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

    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: ''
