Skip to content

Node.js based forum software built for the modern web

#2690

barisusakli385760bddade
diff --git a/src/socket.io/groups.js b/src/socket.io/groups.js
index ea6148c4b7..b2b1b244ed 100644
--- a/src/socket.io/groups.js
+++ b/src/socket.io/groups.js
@@ -38,6 +38,10 @@ SocketGroups.leave = function(socket, data, callback) {
return callback(new Error('[[error:invalid-data]]'));
}
+ if (!parseInt(socket.uid, 10)) {
+ return callback(new Error('[[error:invalid-uid]]'));
+ }
+
groups.leave(data.groupName, socket.uid, callback);
};