Fix leaving gathers when data not defined

This commit is contained in:
Chris Blanchard 2015-09-17 13:56:34 +01:00
parent 8e434ac102
commit ab806776bd

View file

@ -74,7 +74,7 @@ module.exports = function (namespace) {
} }
socket.on("gather:leave", function (data) { socket.on("gather:leave", function (data) {
if (data.gatherer) { if (data && data.gatherer) {
// Remove gatherer defined by ID (admins only) // Remove gatherer defined by ID (admins only)
if (!socket._user.admin) return; if (!socket._user.admin) return;
removeGatherer({ id: data.gatherer }); removeGatherer({ id: data.gatherer });