mirror of
https://github.com/Threnklyn/MinecraftChat.git
synced 2026-05-28 08:48:30 +02:00
Check that socket.mcbot exists before grabbing its entity
This commit is contained in:
@@ -9,7 +9,7 @@ module.exports = (socket) => {
|
|||||||
socket.emit('buffer:error', error);
|
socket.emit('buffer:error', error);
|
||||||
|
|
||||||
// if the bot is logged in and/or is an entity, destroy it
|
// if the bot is logged in and/or is an entity, destroy it
|
||||||
if (socket.mcbot.entity) socket.mcbot.end();
|
if (socket.mcbot && socket.mcbot.entity) socket.mcbot.end();
|
||||||
|
|
||||||
// delete the bot
|
// delete the bot
|
||||||
delete socket.mcbot;
|
delete socket.mcbot;
|
||||||
|
|||||||
Reference in New Issue
Block a user