mirror of
https://github.com/Threnklyn/MinecraftChat.git
synced 2026-05-18 20:33:28 +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);
|
||||
|
||||
// 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 socket.mcbot;
|
||||
|
||||
Reference in New Issue
Block a user