Skip to content

Node.js based forum software built for the modern web

dont call isAdmin if not logged in

barisusakli7bfc36ff56c4
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();