From 7bfc36ff56c48971d39058f98d42f88ae1d5c934 Mon Sep 17 00:00:00 2001 From: barisusakli Date: Mon, 3 Nov 2014 15:09:24 -0500 Subject: [PATCH] dont call isAdmin if not logged in --- src/socket.io/admin.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/socket.io/admin.js b/src/socket.io/admin.js index 7a47508a6a..0a84ddffa1 100644 --- a/src/socket.io/admin.js +++ b/src/socket.io/admin.js @@ -36,6 +36,9 @@ var async = require('async'), }; SocketAdmin.before = function(socket, method, next) { + if (!socket.uid) { + return; + } user.isAdministrator(socket.uid, function(err, isAdmin) { if (!err && isAdmin) { next();