         "Message #{message} has #{parents.length} parents! #{parents}"
 
 @findMessageRoot = (message) ->
+  return message unless message?
   message = Messages.findOne message unless message._id?
   if message.root?
     Messages.findOne message.root

      false
    else
      root = findMessageRoot message
      'public' in root.threadPrivacy and 'private' in root.threadPrivacy

@canAdmin = (group) ->
  groupRoleCheck group, 'admin'

  root = findMessageRoot root  ## can pass message or message ID
  switch privacy
    when true
      unless root?.threadPrivacy? and 'private' in root.threadPrivacy
        throw new Meteor.Error 'checkPrivacy.privateForbidden',
          "Cannot make message private in thread '#{root._id}'"
    when false
      unless root?.threadPrivacy? and 'public' in root.threadPrivacy
        throw new Meteor.Error 'checkPrivacy.publicForbidden',
          "Cannot reate message public in thread '#{root._id}'"
  null

## The following should be called directly only on the server;
