             cb err
 
     getAffiliations: (user, cb) ->
+        unless user
+            return cb(new Error("No user"))
+
         db = @db
         async.waterfall [(cb2) ->
             db.query "SELECT node, affiliation FROM affiliations WHERE \"user\"=$1 ORDER BY updated DESC", [ user ], cb2

        ], cb

    setSubscription: (node, user, listener, subscription, cb) ->
        db = @db
        toDelete = not subscription or subscription == "none"
        async.waterfall [ @validateNode(node)

            cb err

    getSubscribers: (node, cb) ->
        unless node
            return cb(new Error("No node"))

        db = @db
        async.waterfall [(cb2) ->
            db.query "SELECT \"user\", subscription FROM subscriptions WHERE node=$1 ORDER BY updated DESC", [ node ], cb2
